@Test void testInvalidArgs() { parser = new ArgParser(); final String[] args; args = new String[]{"-q", "0000004595", "-y", "MS_187", "-l", testFileSource1, "-p", "/tmp" + pid + ".json"}; assertThrows(RuntimeException.class, () -> { parser.parseConfiguration(args); }); }
public Config parseConfiguration(final String[] args) { final CommandLine c; Config config; try { c = parseConfigArgs(configOptions, args); config = parseConfigFileOptions(c); config = addSharedOptions(c, config); return config; } catch (final ParseException e) { printHelp("Error parsing args: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }
ArgParser { public Config parseConfiguration(final String[] args) { final CommandLine c; Config config; try { c = parseConfigArgs(configOptions, args); config = parseConfigFileOptions(c); config = addSharedOptions(c, config); return config; } catch (final ParseException e) { printHelp("Error parsing args: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } } }
ArgParser { public Config parseConfiguration(final String[] args) { final CommandLine c; Config config; try { c = parseConfigArgs(configOptions, args); config = parseConfigFileOptions(c); config = addSharedOptions(c, config); return config; } catch (final ParseException e) { printHelp("Error parsing args: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }  }
ArgParser { public Config parseConfiguration(final String[] args) { final CommandLine c; Config config; try { c = parseConfigArgs(configOptions, args); config = parseConfigFileOptions(c); config = addSharedOptions(c, config); return config; } catch (final ParseException e) { printHelp("Error parsing args: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }  Config parseConfiguration(final String[] args); }
ArgParser { public Config parseConfiguration(final String[] args) { final CommandLine c; Config config; try { c = parseConfigArgs(configOptions, args); config = parseConfigFileOptions(c); config = addSharedOptions(c, config); return config; } catch (final ParseException e) { printHelp("Error parsing args: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }  Config parseConfiguration(final String[] args);  }