### Question:
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();  }### Answer:
@Test public void ValidWithStaffIdTest() { doNothing().when(spyClientManager).addClinician(any()); String[] inputs = {"-f", "Jack", "-l", "Steel", "-s", "2", "-p", "password"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(1)).addClinician(any()); }
@Test public void ValidNoStaffIdTest() { doNothing().when(spyClientManager).addClinician(any()); String[] inputs = {"-f", "Jack", "-l", "Steel"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }
@Test public void invalidFieldCountLow() { String[] inputs = {"-f", "Jack"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyCreateClient, times(0)).run(); }
@Test public void invalidFieldCountHigh() { String[] inputs = {"-f", "Jack", "-l", "Steel", "extra"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }
@Test public void badRegion() { String[] inputs = {"-f", "Jack", "-l", "Steel", "-r", "non-existant"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }
@Test public void badCountry() { String[] inputs = {"-f", "Jack", "-l", "Steel", "-c", "non-existant"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }
@Test public void duplicateStaffId() { String[] inputs = {"-f", "Jack", "-l", "Steel", "-s", "0"}; CommandLine.run(spyCreateClient, System.out, inputs); verify(spyClientManager, times(0)).addClinician(any()); }