Upgrade to Checkstyle 8.1 and fix violations
This commit is contained in:
@@ -96,7 +96,7 @@ jacoco {
|
||||
|
||||
checkstyle {
|
||||
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
|
||||
toolVersion = "8.0"
|
||||
toolVersion = "8.1"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
</module>
|
||||
<module name="MultipleVariableDeclarations" />
|
||||
<module name="RequireThis">
|
||||
<property name="validateOnlyOverlapping" value="false" />
|
||||
<property name="checkMethods" value="false" />
|
||||
</module>
|
||||
<module name="OneStatementPerLine" />
|
||||
|
||||
@@ -110,7 +110,7 @@ public class DynamoDbMetaDataStore implements ConcurrentMetadataStore, Initializ
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
try {
|
||||
this.table.describe();
|
||||
createTableLatch.countDown();
|
||||
this.createTableLatch.countDown();
|
||||
return;
|
||||
}
|
||||
catch (ResourceNotFoundException e) {
|
||||
@@ -197,7 +197,6 @@ public class DynamoDbMetaDataStore implements ConcurrentMetadataStore, Initializ
|
||||
public String get(String key) {
|
||||
Assert.hasText(key, "'key' must not be empty.");
|
||||
|
||||
|
||||
awaitForActive();
|
||||
|
||||
Item item = this.table.getItem(KEY, key);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user