NitfGmtiTransformer extends SegmentHandler { public Metacard transform(NitfSegmentsFlow nitfSegmentsFlow, Metacard metacard) { if (nitfSegmentsFlow == null) { throw new IllegalArgumentException("argument 'nitfSegmentsFlow' may not be null."); } if (metacard == null) { throw new IllegalArgumentException("argument 'metacard' may not be null."); } transformTargetLocation(metacard); transformAircraftLocation(metacard); return metacard; }  Metacard transform(NitfSegmentsFlow nitfSegmentsFlow, Metacard metacard); void setGeometryFactory(GeometryFactory geometryFactory);  }
@Test(expected = IllegalArgumentException.class) public void testNullNitfSegmentsFlow() { nitfGmtiTransformer.transform(null, new MetacardImpl()); }
@Test(expected = IllegalArgumentException.class) public void testNullMetacard() { NitfSegmentsFlow nitfSegmentsFlow = mock(NitfSegmentsFlow.class); nitfGmtiTransformer.transform(nitfSegmentsFlow, null); }
@Test public void testTre() throws IOException, NitfFormatException { NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(getInputStream(GMTI_TEST_NITF)).allData(); Metacard metacard = metacardFactory.createMetacard("101"); nitfSegmentsFlow = nitfHeaderTransformer.transform(nitfSegmentsFlow, metacard); metacard = nitfGmtiTransformer.transform(nitfSegmentsFlow, metacard); assertNotNull(metacard); validateDate(metacard.getCreatedDate(), "2016-06-22 23:39:22"); validateDate(metacard.getEffectiveDate(), "2016-06-22 23:39:22"); validateDate(metacard.getModifiedDate(), "2016-06-22 23:39:22"); assertThat(metacard.getMetacardType().getName(), is("isr.gmti")); Map<NitfAttribute, String> mtirpbAttributesMap = initMtirpbAttributes(); assertMtirpbAttributes(metacard, mtirpbAttributesMap); }