From b213e23edf68d36b4c0984d94d38d444f96949e2 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 4 Oct 2018 07:06:41 +0100 Subject: Fix creation of sub Avro items When an Avro object is created, nested sub avro objects are not created automatically. This change allows invocation of a method to create sub objects of Avro objects. Issue-ID: POLICY-954 Change-Id: Ie510867f2631ba6a8c6f5452c08aef5db67e8997 Signed-off-by: liamfallon --- .../impl/schema/java/JavaSchemaHelperInstanceCreationTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'context/context-management/src/test') diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java index 800a7011d..14d44ee8b 100644 --- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java +++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java @@ -96,7 +96,6 @@ public class JavaSchemaHelperInstanceCreationTest { } assertEquals(true, schemaHelper0.createNewInstance("true")); - try { schemaHelper1.createNewInstance(); fail("this test should throw an exception here"); @@ -108,5 +107,12 @@ public class JavaSchemaHelperInstanceCreationTest { assertEquals("", schemaHelper2.createNewInstance()); assertEquals("true", schemaHelper2.createNewInstance("true")); + + try { + schemaHelper1.createNewSubInstance("SomeSubtype"); + fail("this test should throw an exception here"); + } catch (final Exception e) { + assertEquals("sub types are not supported on this schema helper", e.getMessage()); + } } } -- cgit 1.2.3-korg