diff options
author | 2016-07-01 16:24:01 +0200 | |
---|---|---|
committer | 2016-07-13 11:28:29 +0200 | |
commit | 9b54d602311bac02fda6881c50db48701509a303 (patch) | |
tree | 58901570c70c25371d28d0db9ebe3ac7030507f0 /v3po/translate-utils/src | |
parent | fb41618f6e78d5f1a20bbf37c45282c5fc15387d (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()); |