### Question:
AppcOrchestratorPreProcessor { public void addVmInfoToAppcTaskRequest(BuildingBlockExecution execution) { try { ApplicationControllerTaskRequest appcTaskRequest = (ApplicationControllerTaskRequest) execution.getVariable("appcOrchestratorRequest"); ArrayList<String> vmIdList = execution.getVariable("vmIdList"); ArrayList<String> vserverIdList = execution.getVariable("vserverIdList"); Integer vmIndex = (Integer) execution.getVariable("vmIndex"); if (vmIdList != null && !vmIdList.isEmpty() && vserverIdList != null && !vserverIdList.isEmpty()) { execution.setVariable("vmIdListSize", vmIdList.size()); if (vmIndex < vmIdList.size()) { ApplicationControllerVm applicationControllerVm = new ApplicationControllerVm(); applicationControllerVm.setVmId(vmIdList.get(vmIndex)); applicationControllerVm.setVserverId(vserverIdList.get(vmIndex)); if (appcTaskRequest.getApplicationControllerVnf() == null) { ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf(); appcTaskRequest.setApplicationControllerVnf(applicationControllerVnf); } appcTaskRequest.getApplicationControllerVnf().setApplicationControllerVm(applicationControllerVm); execution.setVariable("appcOrchestratorRequest", appcTaskRequest); vmIndex++; execution.setVariable("vmIndex", vmIndex); } } } catch (Exception e) { logger.error("Error adding VM info to ApplicationControllerTaskRequest Object", e); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, e); } }  void buildAppcTaskRequest(BuildingBlockExecution execution, String actionName); void addVmInfoToAppcTaskRequest(BuildingBlockExecution execution); static final String CONTROLLER_TYPE_DEFAULT; }### Answer:
@Test public void addVmInfoToAppcTaskRequestTest() throws Exception { ApplicationControllerTaskRequest appcTaskRequest = new ApplicationControllerTaskRequest(); ApplicationControllerVnf applicationControllerVnf = new ApplicationControllerVnf(); appcTaskRequest.setApplicationControllerVnf(applicationControllerVnf); execution.setVariable("appcOrchestratorRequest", appcTaskRequest); ArrayList<String> vmIdList = new ArrayList<String>(); vmIdList.add("http: vmIdList.add("http: vmIdList.add("http: execution.setVariable("vmIdList", vmIdList); ArrayList<String> vserverIdList = new ArrayList<String>(); vserverIdList.add("1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"); vserverIdList.add("14551849-1e70-45cd-bc5d-a256d49548a2"); vserverIdList.add("48bd7f11-408f-417c-b834-b41c1b98f7d7"); execution.setVariable("vserverIdList", vserverIdList); execution.setVariable("vmIndex", 1); appcOrchestratorPreProcessor.addVmInfoToAppcTaskRequest(execution); Integer nextVmIndex = execution.getVariable("vmIndex"); assertThat(nextVmIndex == 2); Integer vmIdListSize = execution.getVariable("vmIdListSize"); assertThat(vmIdListSize == 3); appcTaskRequest = execution.getVariable("appcOrchestratorRequest"); assertEquals(appcTaskRequest.getApplicationControllerVnf().getApplicationControllerVm().getVserverId(), "14551849-1e70-45cd-bc5d-a256d49548a2"); assertEquals(appcTaskRequest.getApplicationControllerVnf().getApplicationControllerVm().getVmId(), "http: }