NIFI-2662 - Fix checkstyle violations introduced by NIFI-2635

Signed-off-by: Matt Burgess <mattyb149@apache.org>

This closes #940
This commit is contained in:
Andre F de Miranda 2016-08-25 22:19:25 +10:00 committed by Matt Burgess
parent e210172d93
commit 6fd1c17ca4
3 changed files with 22 additions and 14 deletions

View File

@ -516,7 +516,9 @@ public class ThreadPoolRequestReplicator implements RequestReplicator {
} }
// Visible for testing - overriding this method makes it easy to verify behavior without actually making any web requests // Visible for testing - overriding this method makes it easy to verify behavior without actually making any web requests
protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder, final NodeIdentifier nodeId, final String method, final URI uri, final String requestId, protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder,
final NodeIdentifier nodeId, final String method,
final URI uri, final String requestId,
final Map<String, String> headers) { final Map<String, String> headers) {
final ClientResponse clientResponse; final ClientResponse clientResponse;
final long startNanos = System.nanoTime(); final long startNanos = System.nanoTime();

View File

@ -164,8 +164,10 @@ public class TestThreadPoolRequestReplicator {
final ThreadPoolRequestReplicator replicator final ThreadPoolRequestReplicator replicator
= new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) { = new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) {
@Override @Override
protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder, final NodeIdentifier nodeId, final String method, protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder,
final URI uri, final String requestId, Map<String, String> givenHeaders) { final NodeIdentifier nodeId, final String method,
final URI uri, final String requestId,
Map<String, String> givenHeaders) {
// the resource builder will not expose its headers to us, so we are using Mockito's Whitebox class to extract them. // the resource builder will not expose its headers to us, so we are using Mockito's Whitebox class to extract them.
final OutBoundHeaders headers = (OutBoundHeaders) Whitebox.getInternalState(resourceBuilder, "metadata"); final OutBoundHeaders headers = (OutBoundHeaders) Whitebox.getInternalState(resourceBuilder, "metadata");
final Object expectsHeader = headers.getFirst(ThreadPoolRequestReplicator.REQUEST_VALIDATION_HTTP_HEADER); final Object expectsHeader = headers.getFirst(ThreadPoolRequestReplicator.REQUEST_VALIDATION_HTTP_HEADER);
@ -286,8 +288,10 @@ public class TestThreadPoolRequestReplicator {
final ThreadPoolRequestReplicator replicator final ThreadPoolRequestReplicator replicator
= new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) { = new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) {
@Override @Override
protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder, final NodeIdentifier nodeId, final String method, protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder,
final URI uri, final String requestId, Map<String, String> givenHeaders) { final NodeIdentifier nodeId, final String method,
final URI uri, final String requestId,
Map<String, String> givenHeaders) {
// the resource builder will not expose its headers to us, so we are using Mockito's Whitebox class to extract them. // the resource builder will not expose its headers to us, so we are using Mockito's Whitebox class to extract them.
final OutBoundHeaders headers = (OutBoundHeaders) Whitebox.getInternalState(resourceBuilder, "metadata"); final OutBoundHeaders headers = (OutBoundHeaders) Whitebox.getInternalState(resourceBuilder, "metadata");
final Object expectsHeader = headers.getFirst(ThreadPoolRequestReplicator.REQUEST_VALIDATION_HTTP_HEADER); final Object expectsHeader = headers.getFirst(ThreadPoolRequestReplicator.REQUEST_VALIDATION_HTTP_HEADER);
@ -329,8 +333,10 @@ public class TestThreadPoolRequestReplicator {
final ThreadPoolRequestReplicator replicator final ThreadPoolRequestReplicator replicator
= new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) { = new ThreadPoolRequestReplicator(2, new Client(), coordinator, "1 sec", "1 sec", null, null, NiFiProperties.createBasicNiFiProperties(null, null)) {
@Override @Override
protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder, final NodeIdentifier nodeId, final String method, protected NodeResponse replicateRequest(final WebResource.Builder resourceBuilder,
final URI uri, final String requestId, Map<String, String> givenHeaders) { final NodeIdentifier nodeId, final String method,
final URI uri, final String requestId,
Map<String, String> givenHeaders) {
if (delayMillis > 0L) { if (delayMillis > 0L) {
try { try {
Thread.sleep(delayMillis); Thread.sleep(delayMillis);