@Test public void printuserinfo_valid() { Client client = new Client("First", "mid", "Last", LocalDate.of(1970, 1, 1), 1); when(spyClientManager.getClientByID(anyInt())).thenReturn(Optional.of(client)); String[] inputs = {"-u", "1"}; CommandLine.run(spyPrintClientInfo, System.out, inputs); assertThat(outContent.toString(), containsString("User: 1. Name: First mid Last, date of birth: 1970-01-01, date of death: null")); }
@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();  }