add small config test for ignoreUnexpectedChildShards

This commit is contained in:
Mike Watters 2017-12-11 18:05:04 -07:00
parent 32e8187261
commit 044fb3a652

View file

@ -17,6 +17,7 @@ package com.amazonaws.services.kinesis.clientlibrary.lib.worker;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import java.util.Date;
@ -407,4 +408,14 @@ public class KinesisClientLibConfigurationTest {
fail("Should not have thrown");
}
}
@Test
public void testKCLConfigurationWithIgnoreUnexpectedChildShards() {
KinesisClientLibConfiguration config =
new KinesisClientLibConfiguration("TestApplication", "TestStream", null, "TestWorker");
// By default, unexpected child shards should not be ignored.
assertFalse(config.shouldIgnoreUnexpectedChildShards());
config = config.withIgnoreUnexpectedChildShards(true);
assertTrue(config.shouldIgnoreUnexpectedChildShards());
}
}