use of org.codice.alliance.libs.klv.Stanag4609Processor in project alliance by codice.
the class MpegTsInputTransformerTest method setup.
@Before
public void setup() throws IOException, CatalogTransformerException {
metacardTypes = Collections.singletonList(mock(MetacardType.class));
stanag4609Processor = mock(Stanag4609Processor.class);
klvHandlerFactory = mock(KlvHandlerFactory.class);
defaultKlvHandler = mock(KlvHandler.class);
streamParser = mock(Stanag4609TransportStreamParser.class);
metacard = new MetacardImpl();
inputTransformer = mock(InputTransformer.class);
stanagParserFactory = mock(StanagParserFactory.class);
klvProcessor = mock(KlvProcessor.class);
when(inputTransformer.transform(any(), any())).thenReturn(metacard);
when(stanagParserFactory.createParser(any())).thenReturn(() -> {
try {
return streamParser.parse();
} catch (Exception e) {
throw new Stanag4609ParseException(e);
}
});
}
Aggregations