### Question:
AppcOrchestratorPreProcessor { protected void getVserversForAppc(BuildingBlockExecution execution, GenericVnf vnf) throws Exception { AAIResultWrapper aaiRW = aaiVnfResources.queryVnfWrapperById(vnf); if (aaiRW != null && aaiRW.getRelationships().isPresent()) { Relationships relationships = aaiRW.getRelationships().get(); if (relationships != null) { List<AAIResourceUri> vserverUris = relationships.getRelatedUris(Types.VSERVER); ArrayList<String> vserverIds = new ArrayList<String>(); ArrayList<String> vserverSelfLinks = new ArrayList<String>(); for (AAIResourceUri j : vserverUris) { String vserverId = j.getURIKeys().get(AAIFluentTypeBuilder.Types.VSERVER.getUriParams().vserverId); vserverIds.add(vserverId); Optional<Vserver> oVserver = aaiVnfResources.getVserver(j); if (oVserver.isPresent()) { Vserver vserver = oVserver.get(); String vserverSelfLink = vserver.getVserverSelflink(); vserverSelfLinks.add(vserverSelfLink); } } logger.debug("vmIdsArray is: {}", vserverSelfLinks); logger.debug("vserverIdsArray is: {}", vserverIds); execution.setVariable("vmIdList", vserverSelfLinks); execution.setVariable("vserverIdList", vserverIds); } } }  void buildAppcTaskRequest(BuildingBlockExecution execution, String actionName); void addVmInfoToAppcTaskRequest(BuildingBlockExecution execution); static final String CONTROLLER_TYPE_DEFAULT; }### Answer:
@Test public void getVserversForAppcTest() throws Exception { GenericVnf genericVnf = getTestGenericVnf(); final String aaiVnfJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json"))); final String aaiVserverJson = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverQueryResponse.json"))); AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(aaiVnfJson); ObjectMapper mapper = new ObjectMapper(); Vserver vserver = mapper.readValue(aaiVserverJson, Vserver.class); doReturn(aaiResultWrapper).when(aaiVnfResources).queryVnfWrapperById(genericVnf); doReturn(Optional.of(vserver)).when(aaiVnfResources).getVserver(ArgumentMatchers.any(AAIResourceUri.class)); appcOrchestratorPreProcessor.getVserversForAppc(execution, genericVnf); ArrayList<String> vserverIdList = execution.getVariable("vserverIdList"); ArrayList<String> expectedVserverIdList = new ArrayList<String>(); expectedVserverIdList.add("1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"); expectedVserverIdList.add("14551849-1e70-45cd-bc5d-a256d49548a2"); expectedVserverIdList.add("48bd7f11-408f-417c-b834-b41c1b98f7d7"); ArrayList<String> vmIdList = execution.getVariable("vmIdList"); ArrayList<String> expectedVmIdList = new ArrayList<String>(); expectedVmIdList.add("http: expectedVmIdList.add("http: expectedVmIdList.add("http: assertEquals(vserverIdList, expectedVserverIdList); assertEquals(vmIdList, expectedVmIdList); }