### Question:
NewDeploymentPreparing { public List<DeployableService> prepare() throws EnactmentException { if (specs.size() == 0) return new ArrayList<DeployableService>(); logger.info("Request to configure nodes; creating services; setting up Chef; for chor " + chorId); submitConfigureTasks(); waitConfigureTasks(); retrieveConfiguredServices(); checkStatus(); logger.info("Nodes are configured to run chef-client on chor " + chorId); return configuredServices; } NewDeploymentPreparing(String chorId, List<DeployableServiceSpec> specs); List<DeployableService> prepare();  }### Answer:
@Test public void shouldProperlyConfigureAllServices() throws ServiceNotCreatedException, EnactmentException { ServiceCreator smMock = mock(ServiceCreator.class); when(smMock.createService(airlineSpec)).thenReturn(airlineService); when(smMock.createService(travelSpec)).thenReturn(travelService); ServiceCreatorFactory.serviceCreatorForTest = smMock; ServiceCreatorFactory.testing = true; NewDeploymentPreparing preparer = new NewDeploymentPreparing(chor.getId(), chor.getChoreographySpec() .getDeployableServiceSpecs()); List<DeployableService> configuredServices = preparer.prepare(); assertEquals(2, configuredServices.size()); String airlineUUID = airlineService.getUUID(); DeployableService configuredAirlineService = findServiceByUUID(airlineUUID, configuredServices); assertEquals(airlineService, configuredAirlineService); String travelUUID = travelService.getUUID(); DeployableService configuredTravelService = findServiceByUUID(travelUUID, configuredServices); assertEquals(travelService, configuredTravelService); ServiceCreatorFactory.testing = false; }