### Question:
SDNOValidatorImpl implements SDNOValidator { protected SDNO buildRequestDiagnostic(GenericVnf vnf, UUID uuid, String requestingUserId) { Optional<String> nfRole; if (vnf.getNfRole() == null) { nfRole = Optional.empty(); } else { nfRole = Optional.of(vnf.getNfRole()); } Input input = new Input(); SDNO parentRequest = new SDNO(); Body body = new Body(); parentRequest.setBody(body); parentRequest.setNodeType(nfRole.orElse("NONE").toUpperCase()); parentRequest.setOperation("health-diagnostic"); body.setInput(input); RequestHealthDiagnostic request = new RequestHealthDiagnostic(); request.setRequestClientName(clientName); request.setRequestNodeName(vnf.getVnfName()); request.setRequestNodeUuid(vnf.getVnfId()); request.setRequestNodeType(nfRole.orElse("NONE").toUpperCase()); request.setRequestNodeIp(vnf.getIpv4OamAddress()); request.setRequestUserId(requestingUserId); request.setRequestId(uuid.toString()); request.setHealthDiagnosticCode(HEALTH_DIAGNOSTIC_CODE_DEFAULT); input.setRequestHealthDiagnostic(request); return parentRequest; }  @Override boolean healthDiagnostic(String vnfId, UUID uuid, String requestingUserId);  }### Answer:
@Test public void buildRequestDiagnosticTest() throws Exception { SDNOValidatorImpl validator = new SDNOValidatorImpl(); UUID uuid = UUID.randomUUID(); GenericVnf vnf = new GenericVnf(); vnf.setVnfName("VNFNAME"); vnf.setVnfId("test"); vnf.setIpv4OamAddress("1.2.3.4"); vnf.setNfRole("VPE"); SDNO request = validator.buildRequestDiagnostic(vnf, uuid, "mechid"); assertEquals(request.getNodeType(), "VPE"); assertEquals(request.getOperation(), "health-diagnostic"); RequestHealthDiagnostic innerRequest = request.getBody().getInput().getRequestHealthDiagnostic(); assertEquals(innerRequest.getRequestClientName(), "MSO"); assertEquals(innerRequest.getRequestNodeName(), "VNFNAME"); assertEquals(innerRequest.getRequestNodeUuid(), "test"); assertEquals(innerRequest.getRequestNodeType(), "VPE"); assertEquals(innerRequest.getRequestNodeIp(), "1.2.3.4"); assertEquals(innerRequest.getRequestUserId(), "mechid"); assertEquals(innerRequest.getRequestId(), uuid.toString()); assertEquals(innerRequest.getHealthDiagnosticCode(), "default"); }