Skip to content
Snippets Groups Projects
Commit e1b768e6 authored by Sören Henning's avatar Sören Henning
Browse files

Minor code quality improvements

parent 7d77ea38
No related branches found
No related tags found
No related merge requests found
Pipeline #6340 failed
...@@ -10,7 +10,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; ...@@ -10,7 +10,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.verify; import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.gson.Gson;
import java.net.URI; import java.net.URI;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
...@@ -21,8 +20,6 @@ public class HttpRecordSenderTest { ...@@ -21,8 +20,6 @@ public class HttpRecordSenderTest {
private HttpRecordSender<ActivePowerRecord> httpRecordSender; private HttpRecordSender<ActivePowerRecord> httpRecordSender;
private Gson gson;
@Rule @Rule
public WireMockRule wireMockRule = new WireMockRule(options().dynamicPort()); public WireMockRule wireMockRule = new WireMockRule(options().dynamicPort());
...@@ -30,7 +27,6 @@ public class HttpRecordSenderTest { ...@@ -30,7 +27,6 @@ public class HttpRecordSenderTest {
public void setup() { public void setup() {
this.httpRecordSender = this.httpRecordSender =
new HttpRecordSender<>(URI.create("http://localhost:" + this.wireMockRule.port())); new HttpRecordSender<>(URI.create("http://localhost:" + this.wireMockRule.port()));
this.gson = new Gson();
} }
@Test @Test
......
...@@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory; ...@@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory;
/** /**
* Logs all Key Value pairs. * Logs all Key Value pairs.
*/ */
@SuppressWarnings({"unused"})
public class LogKeyValue extends DoFn<KV<String, String>, KV<String, String>> { public class LogKeyValue extends DoFn<KV<String, String>, KV<String, String>> {
private static final long serialVersionUID = 4328743; private static final long serialVersionUID = 4328743;
private static final Logger LOGGER = LoggerFactory.getLogger(LogKeyValue.class); private static final Logger LOGGER = LoggerFactory.getLogger(LogKeyValue.class);
...@@ -19,9 +18,7 @@ public class LogKeyValue extends DoFn<KV<String, String>, KV<String, String>> { ...@@ -19,9 +18,7 @@ public class LogKeyValue extends DoFn<KV<String, String>, KV<String, String>> {
@ProcessElement @ProcessElement
public void processElement(@Element final KV<String, String> kv, public void processElement(@Element final KV<String, String> kv,
final OutputReceiver<KV<String, String>> out) { final OutputReceiver<KV<String, String>> out) {
if (LOGGER.isInfoEnabled()) { LOGGER.info("Key: {}, Value: {}", kv.getKey(), kv.getValue());
LOGGER.info("Key: {}, Value: {}", kv.getKey(), kv.getValue());
}
out.output(kv); out.output(kv);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment