Skip to content

Commit

Permalink
Add test for getControlSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeEdgar committed May 11, 2020
1 parent 088edd2 commit ea09b66
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}

0 comments on commit ea09b66

Please sign in to comment.