From ea09b66b23de92ebfb4bb2299876124463f5aeb0 Mon Sep 17 00:00:00 2001 From: Michael Edgar Date: Mon, 11 May 2020 08:41:52 -0400 Subject: [PATCH] Add test for getControlSchema --- .../edi/internal/schema/StaEDISchemaFactoryTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/io/xlate/edi/internal/schema/StaEDISchemaFactoryTest.java b/src/test/java/io/xlate/edi/internal/schema/StaEDISchemaFactoryTest.java index a3c4bbbb..9402bed4 100644 --- a/src/test/java/io/xlate/edi/internal/schema/StaEDISchemaFactoryTest.java +++ b/src/test/java/io/xlate/edi/internal/schema/StaEDISchemaFactoryTest.java @@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test; import io.xlate.edi.schema.EDISchemaException; +import io.xlate.edi.schema.EDIType; import io.xlate.edi.schema.Schema; import io.xlate.edi.schema.SchemaFactory; import io.xlate.edi.stream.EDIStreamConstants.Standards; @@ -253,4 +254,14 @@ public void testDuplicateElementTypeNames() { assertNotNull(cause); assertEquals("duplicate name: DE0004", cause.getMessage()); } + + @Test + public void testGetControlSchema() throws EDISchemaException { + SchemaFactory factory = SchemaFactory.newFactory(); + Schema schema = factory.getControlSchema(Standards.X12, new String[] { "00501" }); + assertNotNull(schema); + assertEquals(EDIType.Type.SEGMENT, schema.getType("ISA").getType()); + assertEquals(EDIType.Type.SEGMENT, schema.getType("GS").getType()); + assertEquals(EDIType.Type.SEGMENT, schema.getType("ST").getType()); + } }