use of org.codice.alliance.video.stream.mpegts.netty.RotateResult in project alliance by codice.
the class FlushPacketBufferStreamShutdownPluginTest method testOnShutdown.
@Test
public void testOnShutdown() throws StreamShutdownException, IOException {
Context context = mock(Context.class);
UdpStreamProcessor udpStreamProcessor = mock(UdpStreamProcessor.class);
PacketBuffer packetBuffer = mock(PacketBuffer.class);
File file = mock(File.class);
when(context.getUdpStreamProcessor()).thenReturn(udpStreamProcessor);
when(udpStreamProcessor.getPacketBuffer()).thenReturn(packetBuffer);
when(packetBuffer.flushAndRotate()).thenReturn(new RotateResult(file, false));
FlushPacketBufferStreamShutdownPlugin flushPacketBufferStreamShutdownPlugin = new FlushPacketBufferStreamShutdownPlugin();
flushPacketBufferStreamShutdownPlugin.onShutdown(context);
verify(udpStreamProcessor).doRollover(file);
}
Aggregations