@Test public void testValidateV1Success() throws FileNotFoundException { when(pathInputStreamFactory.create(testInput)).thenAnswer(invocation -> ConfigMainTest.class.getClassLoader().getResourceAsStream("config-v1.yml")); assertEquals(SUCCESS, configMain.execute(new String[]{ConfigMain.VALIDATE, testInput})); }
public int execute(String[] args) { if (args.length < 1 || !commandMap.containsKey(args[0].toLowerCase())) { printUsage(); return ERR_INVALID_ARGS; } return commandMap.get(args[0].toLowerCase()).function.apply(args); }
ConfigMain { public int execute(String[] args) { if (args.length < 1 || !commandMap.containsKey(args[0].toLowerCase())) { printUsage(); return ERR_INVALID_ARGS; } return commandMap.get(args[0].toLowerCase()).function.apply(args); } }
ConfigMain { public int execute(String[] args) { if (args.length < 1 || !commandMap.containsKey(args[0].toLowerCase())) { printUsage(); return ERR_INVALID_ARGS; } return commandMap.get(args[0].toLowerCase()).function.apply(args); } ConfigMain();  ConfigMain(PathInputStreamFactory pathInputStreamFactory, PathOutputStreamFactory pathOutputStreamFactory); }
ConfigMain { public int execute(String[] args) { if (args.length < 1 || !commandMap.containsKey(args[0].toLowerCase())) { printUsage(); return ERR_INVALID_ARGS; } return commandMap.get(args[0].toLowerCase()).function.apply(args); } ConfigMain();  ConfigMain(PathInputStreamFactory pathInputStreamFactory, PathOutputStreamFactory pathOutputStreamFactory); static void main(String[] args); static void printValidateUsage(); int validate(String[] args); static void printTransformUsage(); static void printUpgradeUsage(); static ConfigSchema transformTemplateToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(VersionedFlowSnapshot versionedFlowSnapshot); int upgrade(String[] args); T loadAndPrintValidationErrors(InputStream inputStream, BiFunction<ConfigSchema, Boolean, T> resultHandler); int transform(String[] args); int execute(String[] args); Map<String, Command> createCommandMap(); void printUsage(); }
ConfigMain { public int execute(String[] args) { if (args.length < 1 || !commandMap.containsKey(args[0].toLowerCase())) { printUsage(); return ERR_INVALID_ARGS; } return commandMap.get(args[0].toLowerCase()).function.apply(args); } ConfigMain();  ConfigMain(PathInputStreamFactory pathInputStreamFactory, PathOutputStreamFactory pathOutputStreamFactory); static void main(String[] args); static void printValidateUsage(); int validate(String[] args); static void printTransformUsage(); static void printUpgradeUsage(); static ConfigSchema transformTemplateToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(InputStream source); static ConfigSchema transformVersionedFlowSnapshotToSchema(VersionedFlowSnapshot versionedFlowSnapshot); int upgrade(String[] args); T loadAndPrintValidationErrors(InputStream inputStream, BiFunction<ConfigSchema, Boolean, T> resultHandler); int transform(String[] args); int execute(String[] args); Map<String, Command> createCommandMap(); void printUsage(); static final int ERR_INVALID_ARGS; static final int ERR_UNABLE_TO_OPEN_OUTPUT; static final int ERR_UNABLE_TO_OPEN_INPUT; static final int ERR_UNABLE_TO_READ_TEMPLATE; static final int ERR_UNABLE_TO_PARSE_CONFIG; static final int ERR_INVALID_CONFIG; static final int ERR_UNABLE_TO_CLOSE_CONFIG; static final int ERR_UNABLE_TO_SAVE_CONFIG; static final int SUCCESS; static final String TRANSFORM; static final String TRANSFORM_VFS; static final String VALIDATE; static final String UPGRADE; static final String THERE_ARE_VALIDATION_ERRORS_WITH_THE_TEMPLATE_STILL_OUTPUTTING_YAML_BUT_IT_WILL_NEED_TO_BE_EDITED; }