@Test public void printuserinfo_invalid_option() { String[] inputs = {"-u", "1", "--notanoption"}; CommandLine.run(spyPrintClientInfo, System.out, inputs); verify(spyPrintClientInfo, times(0)).run(); }
@Override public void run() { Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; } outputStream.println(client.get().getClientInfoString()); }
PrintClientInfo implements Runnable { @Override public void run() { Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; } outputStream.println(client.get().getClientInfoString()); } }
PrintClientInfo implements Runnable { @Override public void run() { Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; } outputStream.println(client.get().getClientInfoString()); } PrintClientInfo();  PrintClientInfo(PrintStream outputStream);  PrintClientInfo(ClientManager manager); }
PrintClientInfo implements Runnable { @Override public void run() { Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; } outputStream.println(client.get().getClientInfoString()); } PrintClientInfo();  PrintClientInfo(PrintStream outputStream);  PrintClientInfo(ClientManager manager); @Override void run(); }
PrintClientInfo implements Runnable { @Override public void run() { Optional<Client> client = manager.getClientByID(uid); if (!client.isPresent()) { outputStream.println("No client exists with that user ID"); return; } outputStream.println(client.get().getClientInfoString()); } PrintClientInfo();  PrintClientInfo(PrintStream outputStream);  PrintClientInfo(ClientManager manager); @Override void run();  }