SecurityAnalysisTool implements Tool { static Network readNetwork(CommandLine line, ToolRunningContext context, ImportersLoader importersLoader) throws IOException { ToolOptions options = new ToolOptions(line, context); Path caseFile = options.getPath(CASE_FILE_OPTION) .orElseThrow(AssertionError::new); Properties inputParams = readProperties(line, ConversionToolUtils.OptionType.IMPORT, context); context.getOutputStream().println("Loading network '" + caseFile + "'"); Network network = Importers.loadNetwork(caseFile, context.getShortTimeExecutionComputationManager(), ImportConfig.load(), inputParams, importersLoader); network.getVariantManager().allowVariantMultiThreadAccess(true); return network; }  @Override Command getCommand(); @Override void run(CommandLine line, ToolRunningContext context);  }
@Test public void readNetwork() throws IOException { ToolRunningContext context = new ToolRunningContext(mock(PrintStream.class), mock(PrintStream.class), fileSystem, mock(ComputationManager.class), mock(ComputationManager.class)); CommandLine cli = mockCommandLine(ImmutableMap.of("case-file", "network.xml"), Collections.emptySet()); SecurityAnalysisTool.readNetwork(cli, context, new ImportersLoaderList(new NetworkImporterMock())); }