### Question:
VnfAdapterDeleteTasks { public void deleteVfModule(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); DeleteVfModuleRequest deleteVfModuleRequest = vnfAdapterVfModuleResources.deleteVfModuleRequest( gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, genericVnf, vfModule); execution.setVariable(VNFREST_REQUEST, deleteVfModuleRequest.toXmlString()); execution.setVariable("deleteVfModuleRequest", "true"); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void deleteVolumeGroup(BuildingBlockExecution execution); void deleteVfModule(BuildingBlockExecution execution);  }### Answer:
@Test public void test_deleteVfModule() throws Exception { DeleteVfModuleRequest deleteVfModuleRequest = new DeleteVfModuleRequest(); deleteVfModuleRequest.setVfModuleId("vfModuleId"); doReturn(deleteVfModuleRequest).when(vnfAdapterVfModuleResources).deleteVfModuleRequest(requestContext, cloudRegion, serviceInstance, genericVnf, vfModule); vnfAdapterDeleteTasks.deleteVfModule(execution); verify(vnfAdapterVfModuleResources, times(1)).deleteVfModuleRequest(ArgumentMatchers.eq(requestContext), ArgumentMatchers.eq(cloudRegion), ArgumentMatchers.eq(serviceInstance), ArgumentMatchers.eq(genericVnf), ArgumentMatchers.eq(vfModule)); assertEquals(execution.getVariable("VNFREST_Request"), deleteVfModuleRequest.toXmlString()); }
@Test public void deleteVfModuleExceptionTest() throws Exception { expectedException.expect(BpmnError.class); doThrow(RuntimeException.class).when(vnfAdapterVfModuleResources).deleteVfModuleRequest(requestContext, cloudRegion, serviceInstance, genericVnf, vfModule); vnfAdapterDeleteTasks.deleteVfModule(execution); }