@Test public void printallinfo_no_clients() { ArrayList<Client> clients = new ArrayList<>(); when(spyClientManager.getClients()).thenReturn(clients); String[] inputs = {}; CommandLine.run(spyPrintAllInfo, System.out, inputs); assertThat(outContent.toString(), containsString("No clients exist")); }
@Override public void run() { List<Client> clients = manager.getClients(); if (clients.isEmpty()) { outputStream.println("No clients exist"); } else { for (Client client : clients) { outputStream.println(client.getClientInfoString()); } } }
PrintAllInfo implements Runnable { @Override public void run() { List<Client> clients = manager.getClients(); if (clients.isEmpty()) { outputStream.println("No clients exist"); } else { for (Client client : clients) { outputStream.println(client.getClientInfoString()); } } } }
PrintAllInfo implements Runnable { @Override public void run() { List<Client> clients = manager.getClients(); if (clients.isEmpty()) { outputStream.println("No clients exist"); } else { for (Client client : clients) { outputStream.println(client.getClientInfoString()); } } } PrintAllInfo();  PrintAllInfo(PrintStream outputStream);  PrintAllInfo(ClientManager manager); }
PrintAllInfo implements Runnable { @Override public void run() { List<Client> clients = manager.getClients(); if (clients.isEmpty()) { outputStream.println("No clients exist"); } else { for (Client client : clients) { outputStream.println(client.getClientInfoString()); } } } PrintAllInfo();  PrintAllInfo(PrintStream outputStream);  PrintAllInfo(ClientManager manager); @Override void run(); }
PrintAllInfo implements Runnable { @Override public void run() { List<Client> clients = manager.getClients(); if (clients.isEmpty()) { outputStream.println("No clients exist"); } else { for (Client client : clients) { outputStream.println(client.getClientInfoString()); } } } PrintAllInfo();  PrintAllInfo(PrintStream outputStream);  PrintAllInfo(ClientManager manager); @Override void run();  }