EndpointsTool { public void printUsage() { System.out.println("Command line tool for Google Cloud Endpoints."); System.out.println(""); System.out.println("usage: <endpoints-tool> <command> <options> [args]"); System.out.println(); System.out.println("<command> must be one of:\n"); for (EndpointsToolAction action : actions.values()) { if (action.isHelpDisplayNeeded()) { System.out.println(action.getNameString()); } } System.out.println(); System.out.println("Use 'help <command>' for a detailed description of a command."); } EndpointsTool(); void execute(String[] args); void printUsage(); void printUsage(Action action); static void main(String[] args);  }
@Test public void testPrintUsage() { tool.printUsage(); String usageMsg = outContent.toString(); assertTrue(usageMsg.contains("usage: <endpoints-tool> <command> <options> [args]")); assertTrue(usageMsg.contains("get-client-lib")); assertTrue(usageMsg.contains("get-discovery-doc")); assertTrue(usageMsg.contains("help")); assertFalse(usageMsg.contains("gen-api-config")); assertFalse(usageMsg.contains("gen-discovery-doc")); assertFalse(usageMsg.contains("gen-client-lib")); }