@Test
public void testHandlerThrowsRuntimeException()
    throws UnsupportedQueryException, SourceUnavailableException, FederationException {

  when(catalogFramework.query(any()))
      .thenAnswer(
          invocationOnMock -> {
            QueryRequest queryRequest = invocationOnMock.getArgument(0);
            switch (queryRequest.getQuery().getStartIndex()) {
              case 1:
                return queryResponse1;
              case 2:
                return queryResponse2;
            }
            return null;
          });
  doThrow(new RuntimeException())
      .doNothing()
      .when(handler)
      .handle(Matchers.eq(context), Matchers.eq(parentMetacard), any(List.class));
  setIsParentDirty(true);
  findChildrenStreamEndPlugin.streamEnded(context);
  assertHandlerCalls(3, 1, 2, 3, 1, 2);
}