@Test public void createclient_invalidFieldCountHigh() { String[] inputs = {"-f", "Jack", "-l", "Steel", "-d", "21/04/1997", "extra"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClient(any()); }
@Override public void run() { if (!force && manager.doesClientExist(firstName, lastName, dateOfBirth)) { outputStream.println("Duplicate client found, use --force to create anyway"); return; } Client client = new Client(firstName, middleNames, lastName, dateOfBirth, null); Action action = new CreateClientAction(client, manager); outputStream.println(invoker.execute(action)); }
CreateClient implements Runnable { @Override public void run() { if (!force && manager.doesClientExist(firstName, lastName, dateOfBirth)) { outputStream.println("Duplicate client found, use --force to create anyway"); return; } Client client = new Client(firstName, middleNames, lastName, dateOfBirth, null); Action action = new CreateClientAction(client, manager); outputStream.println(invoker.execute(action)); } }
CreateClient implements Runnable { @Override public void run() { if (!force && manager.doesClientExist(firstName, lastName, dateOfBirth)) { outputStream.println("Duplicate client found, use --force to create anyway"); return; } Client client = new Client(firstName, middleNames, lastName, dateOfBirth, null); Action action = new CreateClientAction(client, manager); outputStream.println(invoker.execute(action)); } CreateClient(PrintStream outputStream, ActionInvoker invoker);  CreateClient(ClientManager manager, ActionInvoker invoker); }
CreateClient implements Runnable { @Override public void run() { if (!force && manager.doesClientExist(firstName, lastName, dateOfBirth)) { outputStream.println("Duplicate client found, use --force to create anyway"); return; } Client client = new Client(firstName, middleNames, lastName, dateOfBirth, null); Action action = new CreateClientAction(client, manager); outputStream.println(invoker.execute(action)); } CreateClient(PrintStream outputStream, ActionInvoker invoker);  CreateClient(ClientManager manager, ActionInvoker invoker); @Override void run(); }
CreateClient implements Runnable { @Override public void run() { if (!force && manager.doesClientExist(firstName, lastName, dateOfBirth)) { outputStream.println("Duplicate client found, use --force to create anyway"); return; } Client client = new Client(firstName, middleNames, lastName, dateOfBirth, null); Action action = new CreateClientAction(client, manager); outputStream.println(invoker.execute(action)); } CreateClient(PrintStream outputStream, ActionInvoker invoker);  CreateClient(ClientManager manager, ActionInvoker invoker); @Override void run();  }