Upgrade to Checkstyle 8.1 and fix violations

This commit is contained in:
Artem Bilan
2017-08-02 21:19:52 -04:00
parent c4a3fcdee2
commit 0898f6e64c
6 changed files with 17 additions and 14 deletions

View File

@@ -95,10 +95,13 @@ public final class KinesisLocalRunning extends TestWatcher {
return new Statement() {
@Override
public void evaluate() throws Throwable {
try {
base.evaluate();
} finally {
}
finally {
System.clearProperty(SDKGlobalConfiguration.AWS_CBOR_DISABLE_SYSTEM_PROPERTY);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ public class SnsInboundChannelAdapterTests {
.content(StreamUtils.copyToByteArray(this.subscriptionConfirmation.getInputStream())))
.andExpect(status().isNoContent());
Message<?> receive = inputChannel.receive(10000);
Message<?> receive = this.inputChannel.receive(10000);
assertThat(receive).isNotNull();
assertThat(receive.getHeaders().containsKey(AwsHeaders.SNS_MESSAGE_TYPE)).isTrue();
assertThat(receive.getHeaders().get(AwsHeaders.SNS_MESSAGE_TYPE)).isEqualTo("SubscriptionConfirmation");
@@ -121,7 +121,7 @@ public class SnsInboundChannelAdapterTests {
.content(StreamUtils.copyToByteArray(this.notificationMessage.getInputStream())))
.andExpect(status().isNoContent());
Message<?> receive = inputChannel.receive(10000);
Message<?> receive = this.inputChannel.receive(10000);
assertThat(receive).isNotNull();
Map<String, String> payload = (Map<String, String>) receive.getPayload();
@@ -138,7 +138,7 @@ public class SnsInboundChannelAdapterTests {
.content(StreamUtils.copyToByteArray(this.unsubscribeConfirmation.getInputStream())))
.andExpect(status().isNoContent());
Message<?> receive = inputChannel.receive(10000);
Message<?> receive = this.inputChannel.receive(10000);
assertThat(receive).isNotNull();
assertThat(receive.getHeaders().containsKey(AwsHeaders.SNS_MESSAGE_TYPE)).isTrue();
assertThat(receive.getHeaders().get(AwsHeaders.SNS_MESSAGE_TYPE)).isEqualTo("UnsubscribeConfirmation");

View File

@@ -107,13 +107,13 @@ public class DynamoDbMetadataStoreTests {
@Test
public void testPutIfAbsent() throws Exception {
String fileID = store.get(file1);
String fileID = store.get(this.file1);
assertThat(fileID).describedAs("Get First time, Value must not exist").isNull();
fileID = store.putIfAbsent(file1, file1Id);
fileID = store.putIfAbsent(this.file1, this.file1Id);
assertThat(fileID).describedAs("Insert First time, Value must return null").isNull();
fileID = store.putIfAbsent(file1, "56789");
fileID = store.putIfAbsent(this.file1, "56789");
assertThat(fileID).describedAs("Key Already Exists - Insertion Failed, ol value must be returned").isNotNull();
assertThat(fileID).describedAs("The Old Value must be equal to returned").isEqualTo(this.file1Id);
@@ -138,16 +138,16 @@ public class DynamoDbMetadataStoreTests {
@Test
public void testReplace() throws Exception {
boolean removedValue = store.replace(file1, file1Id, "4567");
boolean removedValue = store.replace(this.file1, this.file1Id, "4567");
assertThat(removedValue).isFalse();
String fileID = store.get(this.file1);
assertThat(fileID).isNull();
fileID = store.putIfAbsent(this.file1, file1Id);
fileID = store.putIfAbsent(this.file1, this.file1Id);
assertThat(fileID).isNull();
removedValue = store.replace(this.file1, file1Id, "4567");
removedValue = store.replace(this.file1, this.file1Id, "4567");
assertThat(removedValue).isTrue();
fileID = store.get(this.file1);