diff options
2 files changed, 5 insertions, 0 deletions
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java index 089bb43cd..b7641e01d 100644 --- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java +++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java @@ -48,6 +48,8 @@ final class ContainerNodeDataProcessor extends AbstractYangContextHolder impleme public DataObject getNodeData(@Nonnull YangInstanceIdentifier yangInstanceIdentifier, @Nonnull String resourcePath) { final InputStream resourceStream = this.getClass().getResourceAsStream(resourcePath); + checkState(resourceStream != null, "Resource %s not found", resourcePath); + final YangInstanceIdentifier nodeParent = getNodeParent(yangInstanceIdentifier).orElse(null); final SchemaNode parentSchema = parentSchema(schemaContext(), serializer(), nodeParent, () -> LOG); diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java index 375f55307..c14ea354e 100644 --- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java +++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java @@ -30,6 +30,7 @@ import javax.annotation.Nonnull; import java.io.InputStream; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkState; import static io.fd.honeycomb.translate.util.JsonUtils.readListEntryFromJson; /** @@ -52,6 +53,8 @@ final class ListNodeDataProcessor extends AbstractYangContextHolder implements Y final YangInstanceIdentifier listParent = listNodeParent(nodeIdentifier); final YangInstanceIdentifier.NodeIdentifierWithPredicates keyedNodeIdentifier = listNodeIdentifier(nodeIdentifier); final InputStream resourceStream = this.getClass().getResourceAsStream(resourcePath); + checkState(resourceStream != null, "Resource %s not found", resourcePath); + final SchemaNode parentSchemaNode = parentSchema(schemaContext(), serializer(), listParent, () -> LOG); final MapEntryNode data = readListEntryFromJson(schemaContext(), resourceStream, parentSchemaNode, keyedNodeIdentifier); |