@Test public void invalidFieldCountHigh() { String[] inputs = {"-f", "Jack", "-l", "Steel", "extra"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }
@Override public void run() { if (manager.doesStaffIdExist(staffId)) { outputStream.println("Staff ID " + staffId + " is already taken"); return; } if (!RegionValidator.isValid(country, region)) { outputStream.printf("%s is not a valid NZ region%n", region); return; } Clinician clinician = new Clinician( firstName, middleNames, lastName, workAddress, region, country, staffId, password); Action action = new CreateClinicianAction(clinician, manager); outputStream.println(invoker.execute(action)); LOGGER.log(Level.INFO, action.getExecuteText()); }
CreateClinician implements Runnable { @Override public void run() { if (manager.doesStaffIdExist(staffId)) { outputStream.println("Staff ID " + staffId + " is already taken"); return; } if (!RegionValidator.isValid(country, region)) { outputStream.printf("%s is not a valid NZ region%n", region); return; } Clinician clinician = new Clinician( firstName, middleNames, lastName, workAddress, region, country, staffId, password); Action action = new CreateClinicianAction(clinician, manager); outputStream.println(invoker.execute(action)); LOGGER.log(Level.INFO, action.getExecuteText()); } }
CreateClinician implements Runnable { @Override public void run() { if (manager.doesStaffIdExist(staffId)) { outputStream.println("Staff ID " + staffId + " is already taken"); return; } if (!RegionValidator.isValid(country, region)) { outputStream.printf("%s is not a valid NZ region%n", region); return; } Clinician clinician = new Clinician( firstName, middleNames, lastName, workAddress, region, country, staffId, password); Action action = new CreateClinicianAction(clinician, manager); outputStream.println(invoker.execute(action)); LOGGER.log(Level.INFO, action.getExecuteText()); } CreateClinician(PrintStream outputStream, ActionInvoker invoker);  CreateClinician(ClinicianManager manager, ActionInvoker invoker); }
CreateClinician implements Runnable { @Override public void run() { if (manager.doesStaffIdExist(staffId)) { outputStream.println("Staff ID " + staffId + " is already taken"); return; } if (!RegionValidator.isValid(country, region)) { outputStream.printf("%s is not a valid NZ region%n", region); return; } Clinician clinician = new Clinician( firstName, middleNames, lastName, workAddress, region, country, staffId, password); Action action = new CreateClinicianAction(clinician, manager); outputStream.println(invoker.execute(action)); LOGGER.log(Level.INFO, action.getExecuteText()); } CreateClinician(PrintStream outputStream, ActionInvoker invoker);  CreateClinician(ClinicianManager manager, ActionInvoker invoker); @Override void run(); }
CreateClinician implements Runnable { @Override public void run() { if (manager.doesStaffIdExist(staffId)) { outputStream.println("Staff ID " + staffId + " is already taken"); return; } if (!RegionValidator.isValid(country, region)) { outputStream.printf("%s is not a valid NZ region%n", region); return; } Clinician clinician = new Clinician( firstName, middleNames, lastName, workAddress, region, country, staffId, password); Action action = new CreateClinicianAction(clinician, manager); outputStream.println(invoker.execute(action)); LOGGER.log(Level.INFO, action.getExecuteText()); } CreateClinician(PrintStream outputStream, ActionInvoker invoker);  CreateClinician(ClinicianManager manager, ActionInvoker invoker); @Override void run();  }