use of org.codice.alliance.video.stream.mpegts.Context in project alliance by codice.
the class ListStreamShutdownPluginTest method testOnShutdown.
@Test
public void testOnShutdown() throws StreamShutdownException {
Context context = mock(Context.class);
StreamShutdownPlugin streamShutdownPlugin = mock(StreamShutdownPlugin.class);
ListStreamShutdownPlugin listStreamShutdownPlugin = new ListStreamShutdownPlugin(Collections.singletonList(streamShutdownPlugin));
listStreamShutdownPlugin.onShutdown(context);
verify(streamShutdownPlugin).onShutdown(context);
}
use of org.codice.alliance.video.stream.mpegts.Context in project alliance by codice.
the class LocationUpdateFieldTest method testWhenChildrenHaveEmptyLocation.
@Test
public void testWhenChildrenHaveEmptyLocation() {
Metacard parentMetacard = mock(Metacard.class);
Metacard childMetacard1 = mock(Metacard.class);
when(childMetacard1.getLocation()).thenReturn("");
Metacard childMetacard2 = mock(Metacard.class);
when(childMetacard2.getLocation()).thenReturn("");
Metacard childMetacard3 = mock(Metacard.class);
when(childMetacard3.getLocation()).thenReturn("");
LocationUpdateField locUpdateField = new LocationUpdateField(GeometryOperator.IDENTITY, GeometryOperator.IDENTITY);
Context context = mock(Context.class);
locUpdateField.updateField(parentMetacard, Collections.singletonList(childMetacard1), context);
locUpdateField.updateField(parentMetacard, Arrays.asList(childMetacard2, childMetacard3), context);
locUpdateField.end(parentMetacard, context);
verify(parentMetacard, never()).setAttribute(any());
}
use of org.codice.alliance.video.stream.mpegts.Context in project alliance by codice.
the class LocationUpdateFieldTest method testWhenChildrenAreMissingLocation.
@Test
public void testWhenChildrenAreMissingLocation() {
Metacard parentMetacard = mock(Metacard.class);
Metacard childMetacard1 = mock(Metacard.class);
Metacard childMetacard2 = mock(Metacard.class);
Metacard childMetacard3 = mock(Metacard.class);
LocationUpdateField locUpdateField = new LocationUpdateField(GeometryOperator.IDENTITY, GeometryOperator.IDENTITY);
Context context = mock(Context.class);
locUpdateField.updateField(parentMetacard, Collections.singletonList(childMetacard1), context);
locUpdateField.updateField(parentMetacard, Arrays.asList(childMetacard2, childMetacard3), context);
locUpdateField.end(parentMetacard, context);
verify(parentMetacard, never()).setAttribute(any());
}
use of org.codice.alliance.video.stream.mpegts.Context in project alliance by codice.
the class RolloverStreamCreationPluginTest method testOnCreate.
@Test
public void testOnCreate() throws StreamCreationException {
Context context = mock(Context.class);
UdpStreamProcessor udpStreamProcessor = mock(UdpStreamProcessor.class);
when(context.getUdpStreamProcessor()).thenReturn(udpStreamProcessor);
when(udpStreamProcessor.getFilenameGenerator()).thenReturn(mock(FilenameGenerator.class));
when(udpStreamProcessor.getFilenameTemplate()).thenReturn("template");
when(udpStreamProcessor.getCatalogFramework()).thenReturn(mock(CatalogFramework.class));
when(udpStreamProcessor.getParentMetacardUpdater()).thenReturn(mock(MetacardUpdater.class));
UuidGenerator uuidGenerator = mock(UuidGenerator.class);
when(uuidGenerator.generateUuid()).thenReturn("anId");
when(udpStreamProcessor.getUuidGenerator()).thenReturn(uuidGenerator);
RolloverStreamCreationPlugin rolloverStreamCreationPlugin = new RolloverStreamCreationPlugin();
rolloverStreamCreationPlugin.onCreate(context);
verify(udpStreamProcessor).setRolloverAction(any());
}
use of org.codice.alliance.video.stream.mpegts.Context in project alliance by codice.
the class TimerStreamCreationPluginTest method testOnCreate.
@Test
public void testOnCreate() throws StreamCreationException {
Context context = mock(Context.class);
UdpStreamProcessor udpStreamProcessor = mock(UdpStreamProcessor.class);
Supplier<Timer> timerSupplier = mock(Supplier.class);
Timer timer = mock(Timer.class);
when(context.getUdpStreamProcessor()).thenReturn(udpStreamProcessor);
when(timerSupplier.get()).thenReturn(timer);
TimerStreamCreationPlugin timerStreamCreationPlugin = new TimerStreamCreationPlugin(timerSupplier);
timerStreamCreationPlugin.onCreate(context);
verify(udpStreamProcessor).setTimer(timer);
}
Aggregations