@Test
public void testExternal() throws IOException {

    ExternalSecurityAnalysisConfig config = new ExternalSecurityAnalysisConfig();
    SecurityAnalysis analysis = new ExternalSecurityAnalysis(config, network, cm, Collections.emptyList(), 5);
    analysis.run(VariantManagerConstants.INITIAL_VARIANT_ID, new SecurityAnalysisParameters(), contingencies);
    //Capture the execution handler
    ArgumentCaptor<ExecutionHandler> capt = ArgumentCaptor.forClass(ExecutionHandler.class);
    verify(cm, times(1)).execute(any(), capt.capture());
    //checks methods of the execution handler
    List<CommandExecution> cmd = capt.getValue().before(workingDir);
    checkWorkingDirContent();
    assertEquals(1, cmd.size());
    assertEquals(1, cmd.get(0).getExecutionCount());
}