### Question:
SDNCRequestTasks { public void callSDNC(DelegateExecution execution) { SDNCRequest request = (SDNCRequest) execution.getVariable(SDNC_REQUEST); try { String response = sdncClient.post(request.getSDNCPayload(), request.getTopology()); String finalMessageIndicator = JsonPath.read(response, "$.output.ack-final-indicator"); execution.setVariable("isSDNCCompleted", convertIndicatorToBoolean(finalMessageIndicator)); } catch (PathNotFoundException e) { logger.error("Error Parsing SDNC Response. Could not find read final ack indicator from JSON.", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Recieved invalid response from SDNC, unable to read message content.", ONAPComponents.SO); } catch (MapperException e) { logger.error("Failed to map SDNC object to JSON prior to POST.", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Failed to map SDNC object to JSON prior to POST.", ONAPComponents.SO); } catch (BadResponseException e) { logger.error("Did not receive a successful response from SDNC.", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getLocalizedMessage(), ONAPComponents.SDNC); } catch (HttpClientErrorException e) { logger.error("HttpClientErrorException: 404 Not Found, Failed to contact SDNC", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "SDNC cannot be contacted.", ONAPComponents.SO); } }  void createCorrelationVariables(DelegateExecution execution); void callSDNC(DelegateExecution execution); void processCallback(DelegateExecution execution); void handleTimeOutException(DelegateExecution execution);  }### Answer:
@Test public void callSDNC_Final_Test() throws MapperException, BadResponseException, IOException { final String sdncResponse = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/SDNCClientPut200Response.json"))); doReturn(sdncResponse).when(sdncClient).post(createSDNCRequest().getSDNCPayload(), SDNCTopology.CONFIGURATION); sndcRequestTasks.callSDNC(delegateExecution); assertEquals(true, delegateExecution.getVariable("isSDNCCompleted")); }
@Test public void callSDNC_Not_Final_Test() throws MapperException, BadResponseException, IOException { final String sdncResponse = new String( Files.readAllBytes(Paths.get("src/test/resources/__files/SDNCClientPut200ResponseNotFinal.json"))); doReturn(sdncResponse).when(sdncClient).post(createSDNCRequest().getSDNCPayload(), SDNCTopology.CONFIGURATION); sndcRequestTasks.callSDNC(delegateExecution); assertEquals(false, delegateExecution.getVariable("isSDNCCompleted")); }
@Test public void callSDNC_Error_Test() throws MapperException, BadResponseException { doThrow(MapperException.class).when(sdncClient).post(createSDNCRequest().getSDNCPayload(), SDNCTopology.CONFIGURATION); doReturn("processKey").when(exceptionBuilder).getProcessKey(delegateExecution); expectedException.expect(BpmnError.class); sndcRequestTasks.callSDNC(delegateExecution); }