### Question:
SDNCLcmPayloadBuilder { public static DownloadNESwPayload buildDownloadNESwPayload(DelegateExecution execution) { String requestPayload = String.valueOf(execution.getVariable(REQUEST_PAYLOAD)); DownloadNESwPayload downloadNESwPayload = new DownloadNESwPayload(); String ipaddressV4Oam = JsonUtils.getJsonValue(requestPayload, "ipaddressV4Oam"); downloadNESwPayload.setIpaddressV4Oam(ipaddressV4Oam); String swToBeDownloadedString = JsonUtils.getJsonValue(requestPayload, "swToBeDownloaded"); SwToBeDownloadedElement[] swToBeDownloadedArray; ObjectMapper mapper = new ObjectMapper(); try { swToBeDownloadedArray = mapper.readValue(swToBeDownloadedString, SwToBeDownloadedElement[].class); downloadNESwPayload.setSwToBeDownloaded(Arrays.asList(swToBeDownloadedArray)); } catch (Exception e) { logger.error("Parse SwToBeDownloaded error: ", e); } String playbookName = JsonUtils.getJsonValue(requestPayload, "downloadNESwPlaybook"); if (playbookName != null) { downloadNESwPayload.setPlaybookName(playbookName); } return downloadNESwPayload; }  static ActivateNESwPayload buildActivateNESwPayload(DelegateExecution execution); static DownloadNESwPayload buildDownloadNESwPayload(DelegateExecution execution); static UpgradePostCheckPayload buildUpgradePostCheckPayload(DelegateExecution execution); static UpgradePreCheckPayload buildUpgradePreCheckPayload(DelegateExecution execution); static String convertToSting(Object msgObject);  }### Answer:
@Test public final void testBuildDownloadNESwPayload() { String expectedSwToBeDownloadedElement = "{" + "\"swLocation\":\"http: + "\"swFileSize\":123456," + "\"swFileCompression\":\"ZIP\"," + "\"swFileFormat\":\"binary\"" + "}"; String expectedPayload = "{" + "\"ipaddress-v4-oam\":\"192.168.1.10\"," + "\"playbook-name\":\"downloadnesw_playbook\"," + "\"swToBeDownloaded\":[" + expectedSwToBeDownloadedElement + "]" + "}"; DownloadNESwPayload downloadNESwPayload = SDNCLcmPayloadBuilder.buildDownloadNESwPayload(execution); try { String payload = SDNCLcmPayloadBuilder.convertToSting(downloadNESwPayload); logger.debug("DownloadNESwPayload:\n" + payload); assertEquals(expectedPayload, payload); } catch (JsonProcessingException e) { fail("Convert DownloadNESwPayload to String error: " + e.toString()); } }