Search in sources :

Example 1 with KlvHandlerFactory

use of org.codice.alliance.libs.klv.KlvHandlerFactory 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);
        }
    });
}
Also used : Stanag4609TransportStreamParser(org.codice.alliance.libs.stanag4609.Stanag4609TransportStreamParser) KlvHandlerFactory(org.codice.alliance.libs.klv.KlvHandlerFactory) KlvHandler(org.codice.alliance.libs.klv.KlvHandler) StanagParserFactory(org.codice.alliance.libs.klv.StanagParserFactory) Stanag4609Processor(org.codice.alliance.libs.klv.Stanag4609Processor) Stanag4609ParseException(org.codice.alliance.libs.klv.Stanag4609ParseException) InputTransformer(ddf.catalog.transform.InputTransformer) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) Stanag4609ParseException(org.codice.alliance.libs.klv.Stanag4609ParseException) IOException(java.io.IOException) CatalogTransformerException(ddf.catalog.transform.CatalogTransformerException) KlvProcessor(org.codice.alliance.libs.klv.KlvProcessor) SecurityClassificationKlvProcessor(org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor) Before(org.junit.Before)

Aggregations

MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 CatalogTransformerException (ddf.catalog.transform.CatalogTransformerException)1 InputTransformer (ddf.catalog.transform.InputTransformer)1 IOException (java.io.IOException)1 KlvHandler (org.codice.alliance.libs.klv.KlvHandler)1 KlvHandlerFactory (org.codice.alliance.libs.klv.KlvHandlerFactory)1 KlvProcessor (org.codice.alliance.libs.klv.KlvProcessor)1 SecurityClassificationKlvProcessor (org.codice.alliance.libs.klv.SecurityClassificationKlvProcessor)1 Stanag4609ParseException (org.codice.alliance.libs.klv.Stanag4609ParseException)1 Stanag4609Processor (org.codice.alliance.libs.klv.Stanag4609Processor)1 StanagParserFactory (org.codice.alliance.libs.klv.StanagParserFactory)1 Stanag4609TransportStreamParser (org.codice.alliance.libs.stanag4609.Stanag4609TransportStreamParser)1 Before (org.junit.Before)1