### Question:
NetworkAdapterDeleteTasks { public void deleteNetwork(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID); ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); DeleteNetworkRequest deleteNetworkRequest = networkAdapterObjectMapper.deleteNetworkRequestMapper( gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, l3Network); execution.setVariable("networkAdapterRequest", deleteNetworkRequest.toXmlString()); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void deleteNetwork(BuildingBlockExecution execution);  }### Answer:
@Test public void test_deleteNetwork() throws UnsupportedEncodingException, NetworkAdapterClientException { DeleteNetworkRequest deleteNetworkRequest = new DeleteNetworkRequest(); doReturn(deleteNetworkRequest).when(networkAdapterObjectMapper).deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); networkAdapterDeleteTasks.deleteNetwork(execution); verify(networkAdapterObjectMapper, times(1)).deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); }
@Test public void test_deleteNetwork_exception() throws UnsupportedEncodingException, NetworkAdapterClientException { expectedException.expect(BpmnError.class); doThrow(RuntimeException.class).when(networkAdapterObjectMapper).deleteNetworkRequestMapper( any(RequestContext.class), any(CloudRegion.class), any(ServiceInstance.class), eq(l3Network)); networkAdapterDeleteTasks.deleteNetwork(execution); }