Remove tests that no longer work (#346)
The new version of the SDK no longer returns null on an unknown region. There's not much we can do but run with whatever region is configured
This commit is contained in:
parent
2483f8cbf8
commit
f1d60ec1a6
3 changed files with 1 additions and 59 deletions
2
pom.xml
2
pom.xml
|
|
@ -25,7 +25,7 @@
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<aws-java-sdk.version>1.11.319</aws-java-sdk.version>
|
<aws-java-sdk.version>1.11.344</aws-java-sdk.version>
|
||||||
<sqlite4java.version>1.0.392</sqlite4java.version>
|
<sqlite4java.version>1.0.392</sqlite4java.version>
|
||||||
<sqlite4java.native>libsqlite4java</sqlite4java.native>
|
<sqlite4java.native>libsqlite4java</sqlite4java.native>
|
||||||
<sqlite4java.libpath>${project.build.directory}/test-lib</sqlite4java.libpath>
|
<sqlite4java.libpath>${project.build.directory}/test-lib</sqlite4java.libpath>
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,6 @@ public class KinesisClientLibConfiguration {
|
||||||
checkIsValuePositive("MetricsBufferTimeMills", metricsBufferTimeMillis);
|
checkIsValuePositive("MetricsBufferTimeMills", metricsBufferTimeMillis);
|
||||||
checkIsValuePositive("MetricsMaxQueueSize", (long) metricsMaxQueueSize);
|
checkIsValuePositive("MetricsMaxQueueSize", (long) metricsMaxQueueSize);
|
||||||
checkIsValuePositive("ShutdownGraceMillis", shutdownGraceMillis);
|
checkIsValuePositive("ShutdownGraceMillis", shutdownGraceMillis);
|
||||||
checkIsRegionNameValid(regionName);
|
|
||||||
this.applicationName = applicationName;
|
this.applicationName = applicationName;
|
||||||
this.tableName = applicationName;
|
this.tableName = applicationName;
|
||||||
this.streamName = streamName;
|
this.streamName = streamName;
|
||||||
|
|
@ -567,7 +566,6 @@ public class KinesisClientLibConfiguration {
|
||||||
checkIsValuePositive("TaskBackoffTimeMillis", taskBackoffTimeMillis);
|
checkIsValuePositive("TaskBackoffTimeMillis", taskBackoffTimeMillis);
|
||||||
checkIsValuePositive("MetricsBufferTimeMills", metricsBufferTimeMillis);
|
checkIsValuePositive("MetricsBufferTimeMills", metricsBufferTimeMillis);
|
||||||
checkIsValuePositive("MetricsMaxQueueSize", (long) metricsMaxQueueSize);
|
checkIsValuePositive("MetricsMaxQueueSize", (long) metricsMaxQueueSize);
|
||||||
checkIsRegionNameValid(regionName);
|
|
||||||
this.applicationName = applicationName;
|
this.applicationName = applicationName;
|
||||||
this.tableName = applicationName;
|
this.tableName = applicationName;
|
||||||
this.streamName = streamName;
|
this.streamName = streamName;
|
||||||
|
|
@ -630,12 +628,6 @@ public class KinesisClientLibConfiguration {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkIsRegionNameValid(String regionNameToCheck) {
|
|
||||||
if (regionNameToCheck != null && RegionUtils.getRegion(regionNameToCheck) == null) {
|
|
||||||
throw new IllegalArgumentException("The specified region name is not valid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Name of the application
|
* @return Name of the application
|
||||||
*/
|
*/
|
||||||
|
|
@ -1214,7 +1206,6 @@ public class KinesisClientLibConfiguration {
|
||||||
*/
|
*/
|
||||||
// CHECKSTYLE:IGNORE HiddenFieldCheck FOR NEXT 2 LINES
|
// CHECKSTYLE:IGNORE HiddenFieldCheck FOR NEXT 2 LINES
|
||||||
public KinesisClientLibConfiguration withRegionName(String regionName) {
|
public KinesisClientLibConfiguration withRegionName(String regionName) {
|
||||||
checkIsRegionNameValid(regionName);
|
|
||||||
this.regionName = regionName;
|
this.regionName = regionName;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -281,56 +281,7 @@ public class KinesisClientLibConfigurationTest {
|
||||||
Mockito.verify(kclConfig, Mockito.times(2)).getKinesisEndpoint();
|
Mockito.verify(kclConfig, Mockito.times(2)).getKinesisEndpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testKCLConfigurationWithMultiRegionWithIlligalRegionName() {
|
|
||||||
// test with illegal region name
|
|
||||||
AWSCredentialsProvider credentialsProvider = Mockito.mock(AWSCredentialsProvider.class);
|
|
||||||
|
|
||||||
KinesisClientLibConfiguration kclConfig =
|
|
||||||
new KinesisClientLibConfiguration("Test", "Test", credentialsProvider, "0");
|
|
||||||
try {
|
|
||||||
kclConfig = kclConfig.withRegionName("abcd");
|
|
||||||
Assert.fail("No expected Exception is thrown.");
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
System.out.println(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testKCLConfigurationWithMultiRegionWithIlligalRegionNameInFullConstructor() {
|
|
||||||
// test with illegal region name
|
|
||||||
Mockito.mock(AWSCredentialsProvider.class);
|
|
||||||
try {
|
|
||||||
new KinesisClientLibConfiguration(TEST_STRING,
|
|
||||||
TEST_STRING,
|
|
||||||
TEST_STRING,
|
|
||||||
TEST_STRING,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
TEST_STRING,
|
|
||||||
3,
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
false,
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
true,
|
|
||||||
new ClientConfiguration(),
|
|
||||||
new ClientConfiguration(),
|
|
||||||
new ClientConfiguration(),
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
TEST_VALUE_LONG,
|
|
||||||
1,
|
|
||||||
skipCheckpointValidationValue,
|
|
||||||
"abcd",
|
|
||||||
TEST_VALUE_LONG);
|
|
||||||
Assert.fail("No expected Exception is thrown.");
|
|
||||||
} catch(IllegalArgumentException e) {
|
|
||||||
System.out.println(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testKCLConfigurationMetricsDefaults() {
|
public void testKCLConfigurationMetricsDefaults() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue