### Question:
ConsoleServiceFactory implements ServiceFactory { @Override public Service getService(final String calledToolToken) { if (OrganizationImportService.TOKEN.equals(calledToolToken)) { return new OrganizationImportService(); } else if (ProcessActorImportService.TOKEN.equals(calledToolToken)) { return new ProcessActorImportService(); } else if (ApplicationsImportService.TOKEN.equals(calledToolToken)) { return new ApplicationsImportService(); } throw new ServiceNotFoundException(calledToolToken); }  @Override Service getService(final String calledToolToken);  }### Answer:
@Test public void getService_should_return_OrganizationImportService_when_organization_import() throws Exception { ConsoleServiceFactory consoleServiceFacotry = new ConsoleServiceFactory(); Service service = consoleServiceFacotry.getService("/organization/import"); assertThat(service).isInstanceOf(OrganizationImportService.class); }
@Test public void getService_should_return_ProcessActorImportService_when_bpm_process_importActors() throws Exception { ConsoleServiceFactory consoleServiceFacotry = new ConsoleServiceFactory(); Service service = consoleServiceFacotry.getService("/bpm/process/importActors"); assertThat(service).isInstanceOf(ProcessActorImportService.class); }
@Test(expected=ServiceNotFoundException.class) public void getService_should_throw_ServiceNotFoundException_when_invalid_input(){ ConsoleServiceFactory consoleServiceFacotry = new ConsoleServiceFactory(); consoleServiceFacotry.getService("invalidService"); }