@Test
public void testGetNitfSegmentsFlow()
    throws IOException, NitfFormatException, InterruptedException {

  Resource resource = mock(Resource.class);
  when(resource.getInputStream()).thenReturn(getInputStream("/i_3001a.ntf"));
  ResourceResponse resourceResponse = mock(ResourceResponse.class);
  when(resourceResponse.getResource()).thenReturn(resource);
  NitfSegmentsFlow nitfSegmentsFlow = catalogOutputAdapter.getNitfSegmentsFlow(resourceResponse);
  assertThat(nitfSegmentsFlow, notNullValue());
  verify(lock).acquire();
  verify(lock).release();
}