diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-07-01 16:24:01 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-07-13 11:28:29 +0200 |
commit | 40da600c311b18c628410af5f795c25c6e248cf6 (patch) | |
tree | 15bad416d5a2d020d840b505a738ce269f01ce31 /v3po/translate-utils/src | |
parent | 9f6b16d6e8ade6dfa40e9bbf4196d55adf8f2fec (diff) |
Introduce integration tests to Honeycomb
+ Add writer infrastructure initial test
Change-Id: I0c1017f55c9456f145943ca6db6221555b746c8f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/translate-utils/src')
2 files changed, 3 insertions, 6 deletions
diff --git a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistry.java b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistry.java index 79d8eb88d..4abad23a6 100644 --- a/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistry.java +++ b/v3po/translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistry.java @@ -17,7 +17,6 @@ package io.fd.honeycomb.v3po.translate.util.write.registry; import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.Optional; import com.google.common.collect.HashMultimap; @@ -261,11 +260,9 @@ final class FlatWriterRegistry implements WriterRegistry { return !Sets.intersection(writer.getHandledChildTypes(), updates.keySet()).isEmpty(); } + @Nullable private Writer<?> getWriter(@Nonnull final InstanceIdentifier<?> singleType) { - final Writer<?> writer = writers.get(singleType); - checkNotNull(writer, - "Unable to write %s. Missing writer. Current writers for: %s", singleType, writers.keySet()); - return writer; + return writers.get(singleType); } @Nonnull diff --git a/v3po/translate-utils/src/test/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistryTest.java b/v3po/translate-utils/src/test/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistryTest.java index 7fb5779f3..df3296557 100644 --- a/v3po/translate-utils/src/test/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistryTest.java +++ b/v3po/translate-utils/src/test/java/io/fd/honeycomb/v3po/translate/util/write/registry/FlatWriterRegistryTest.java @@ -272,7 +272,7 @@ public class FlatWriterRegistryTest { updates.put(iid, DataObjectUpdate.create(iid, mock(type), mock(type))); } - @Test(expected = NullPointerException.class) + @Test(expected = IllegalArgumentException.class) public void testSingleUpdateMissingWriter() throws Exception { final FlatWriterRegistry flatWriterRegistry = new FlatWriterRegistry(ImmutableMap.of()); |