### Question:
AAIDeleteTasks { public void deleteServiceInstance(BuildingBlockExecution execution) throws Exception { try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); aaiSIResources.deleteServiceInstance(serviceInstance); } catch (Exception ex) { logger.error("Exception occurred in AAIDeleteTasks deleteServiceInstance process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void deleteVfModule(BuildingBlockExecution execution); void deleteVnf(BuildingBlockExecution execution); void deleteServiceInstance(BuildingBlockExecution execution); void deleteNetwork(BuildingBlockExecution execution); void deleteCollection(BuildingBlockExecution execution); void deleteInstanceGroup(BuildingBlockExecution execution); void deleteVolumeGroup(BuildingBlockExecution execution); void deleteConfiguration(BuildingBlockExecution execution); void deleteInstanceGroupVnf(BuildingBlockExecution execution); void deleteNetworkPolicies(BuildingBlockExecution execution);  }### Answer:
@Test public void deleteServiceInstanceTest() throws Exception { doNothing().when(aaiServiceInstanceResources).deleteServiceInstance(serviceInstance); aaiDeleteTasks.deleteServiceInstance(execution); verify(aaiServiceInstanceResources, times(1)).deleteServiceInstance(serviceInstance); }
@Test public void deleteServiceInstanceExceptionTest() throws Exception { expectedException.expect(BpmnError.class); doThrow(RuntimeException.class).when(aaiServiceInstanceResources).deleteServiceInstance(serviceInstance); aaiDeleteTasks.deleteServiceInstance(execution); }