@Test
public void parseInputs() throws IOException {

    ToolOptions options = emptyOptions();
    SecurityAnalysisExecutionInput input = new SecurityAnalysisExecutionInput();
    SecurityAnalysisTool.updateInput(options, input);
    assertThat(input.getViolationTypes()).isEmpty();
    assertThat(input.getResultExtensions()).isEmpty();
    assertThat(input.getContingenciesSource()).isNotPresent();
    options = mockOptions(ImmutableMap.of(SecurityAnalysisToolConstants.LIMIT_TYPES_OPTION, "HIGH_VOLTAGE,CURRENT"));
    SecurityAnalysisTool.updateInput(options, input);
    assertThat(input.getViolationTypes()).containsExactly(LimitViolationType.CURRENT, LimitViolationType.HIGH_VOLTAGE);
    options = mockOptions(ImmutableMap.of(SecurityAnalysisToolConstants.WITH_EXTENSIONS_OPTION, "ext1,ext2"));
    SecurityAnalysisTool.updateInput(options, input);
    assertThat(input.getResultExtensions()).containsExactly("ext1", "ext2");
    ToolOptions invalidOptions = mockOptions(ImmutableMap.of(SecurityAnalysisToolConstants.CONTINGENCIES_FILE_OPTION, "contingencies"));
    assertThatIllegalArgumentException().isThrownBy(() -> SecurityAnalysisTool.updateInput(invalidOptions, input));
    Files.write(fileSystem.getPath("contingencies"), "test".getBytes());
    options = mockOptions(ImmutableMap.of(SecurityAnalysisToolConstants.CONTINGENCIES_FILE_OPTION, "contingencies"));
    SecurityAnalysisTool.updateInput(options, input);
    assertThat(input.getContingenciesSource()).isPresent();
    if (input.getContingenciesSource().isPresent()) {
        assertEquals("test", new String(input.getContingenciesSource().get().read()));
    } else {
        fail();
    }
}