diff --git a/src/test/java/com/solab/iso8583/TestConfigParser.java b/src/test/java/com/solab/iso8583/TestConfigParser.java index 55e4120..3b050ff 100644 --- a/src/test/java/com/solab/iso8583/TestConfigParser.java +++ b/src/test/java/com/solab/iso8583/TestConfigParser.java @@ -133,16 +133,15 @@ public class TestConfigParser { Assert.assertFalse(m.hasField(4)); } - @Test - public void testNestedCompositeTemplate() throws IOException { + private void testNestedCompositeTemplate(int type, int fnum) throws IOException { MessageFactory mfact = config("composites.xml"); - IsoMessage m = mfact.newMessage(0x101); + IsoMessage m = mfact.newMessage(type); Assert.assertNotNull(m); Assert.assertFalse(m.hasField(1)); Assert.assertFalse(m.hasField(2)); Assert.assertFalse(m.hasField(3)); Assert.assertFalse(m.hasField(4)); - CompositeField f = m.getObjectValue(10); + CompositeField f = m.getObjectValue(fnum); Assert.assertEquals(f.getObjectValue(0), "fghij"); Assert.assertEquals(f.getObjectValue(2), "67890"); Assert.assertEquals(f.getObjectValue(3), "Y"); @@ -154,6 +153,17 @@ public class TestConfigParser { Assert.assertEquals(f.getObjectValue(1), "45"); } + @Test + public void testNestedCompositeTemplate() throws IOException { + testNestedCompositeTemplate(0x101, 10); + } + + @Test + public void testNestedCompositeFromExtendedTemplate() throws IOException { + testNestedCompositeTemplate(0x102, 10); + testNestedCompositeTemplate(0x102, 12); + } + @Test //issue 34 public void testMultilevelExtendParseGuides() throws IOException, ParseException { final MessageFactory mfact = config("issue34.xml");