### Question:
AAICreateTasks { public void createProject(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); Project project = serviceInstance.getProject(); if (project != null) { if (project.getProjectName() == null || "".equals(project.getProjectName())) { logger.info("ProjectName is null in input. Skipping create project..."); } else { aaiSIResources.createProjectandConnectServiceInstance(project, serviceInstance); } } } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void createServiceInstance(BuildingBlockExecution execution); void createServiceSubscription(BuildingBlockExecution execution); void createProject(BuildingBlockExecution execution); void createOwningEntity(BuildingBlockExecution execution); void createVnf(BuildingBlockExecution execution); void createPnf(BuildingBlockExecution execution); void createPlatformForNetwork(BuildingBlockExecution execution); void createPlatform(BuildingBlockExecution execution); List<String> splitCDL(String str); void createLineOfBusiness(BuildingBlockExecution execution); void createLineOfBusinessForNetwork(BuildingBlockExecution execution); void createVolumeGroup(BuildingBlockExecution execution); void createVfModule(BuildingBlockExecution execution); void connectVfModuleToVolumeGroup(BuildingBlockExecution execution); void createNetwork(BuildingBlockExecution execution); void createCustomer(BuildingBlockExecution execution); void createNetworkCollection(BuildingBlockExecution execution); void createNetworkCollectionInstanceGroup(BuildingBlockExecution execution); void connectNetworkToTenant(BuildingBlockExecution execution); void connectNetworkToCloudRegion(BuildingBlockExecution execution); void connectVnfToCloudRegion(BuildingBlockExecution execution); void connectVnfToTenant(BuildingBlockExecution execution); void connectNetworkToNetworkCollectionServiceInstance(BuildingBlockExecution execution); void connectNetworkToNetworkCollectionInstanceGroup(BuildingBlockExecution execution); void createConfiguration(BuildingBlockExecution execution); void createInstanceGroupVnf(BuildingBlockExecution execution); void createNetworkPolicies(BuildingBlockExecution execution);  }### Answer:
@Test public void createProjectTest() throws Exception { doNothing().when(aaiServiceInstanceResources) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); aaiCreateTasks.createProject(execution); verify(aaiServiceInstanceResources, times(1)) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); }
@Test public void createProjectExceptionTest() throws Exception { expectedException.expect(BpmnError.class); lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, "notfound"); doThrow(RuntimeException.class).when(aaiServiceInstanceResources) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); aaiCreateTasks.createProject(execution); }
@Test public void createProjectNullProjectNameTest() throws Exception { serviceInstance.getProject().setProjectName(null); doNothing().when(aaiServiceInstanceResources) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); aaiCreateTasks.createProject(execution); verify(aaiServiceInstanceResources, times(0)) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); }
@Test public void createProjectEmptyProjectNameTest() throws Exception { serviceInstance.getProject().setProjectName(""); doNothing().when(aaiServiceInstanceResources) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); aaiCreateTasks.createProject(execution); verify(aaiServiceInstanceResources, times(0)) .createProjectandConnectServiceInstance(serviceInstance.getProject(), serviceInstance); }