### Question:
BBInputSetup implements JavaDelegate { protected GeneralBuildingBlock getGBB(ExecuteBuildingBlock executeBB, Map<ResourceKey, String> lookupKeyMap, String requestAction, boolean aLaCarte, String resourceId, String vnfType) throws Exception { String requestId = executeBB.getRequestId(); this.populateLookupKeyMapWithIds(executeBB.getWorkflowResourceIds(), lookupKeyMap); RequestDetails requestDetails = executeBB.getRequestDetails(); if (requestDetails == null) { requestDetails = bbInputSetupUtils.getRequestDetails(requestId); } if (requestDetails.getModelInfo() == null) { return this.getGBBCM(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId); } else { ModelType modelType = requestDetails.getModelInfo().getModelType(); if (aLaCarte && modelType.equals(ModelType.service)) { return this.getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId); } else if (aLaCarte && !modelType.equals(ModelType.service)) { return this.getGBBALaCarteNonService(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType); } else { return this.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType); } } }  BBInputSetupUtils getBbInputSetupUtils(); void setCloudInfoFromAAI(CloudInfoFromAAI cloudInfoFromAAI); void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils); BBInputSetupMapperLayer getMapperLayer(); void setMapperLayer(BBInputSetupMapperLayer mapperLayer); @Override void execute(DelegateExecution execution); ServiceInstance getExistingServiceInstance(org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI);  }### Answer:
@Test public void testGetGBB() throws Exception { GeneralBuildingBlock expected = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"), GeneralBuildingBlock.class); ExecuteBuildingBlock executeBB = new ExecuteBuildingBlock().setRequestId("requestId"); RequestDetails requestDetails = new RequestDetails(); ModelInfo modelInfo = new ModelInfo(); modelInfo.setModelType(ModelType.service); requestDetails.setModelInfo(modelInfo); RequestParameters requestParams = new RequestParameters(); requestParams.setaLaCarte(true); requestDetails.setRequestParameters(requestParams); doReturn(requestDetails).when(SPY_bbInputSetupUtils).getRequestDetails(executeBB.getRequestId()); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); String resourceId = "123"; String requestAction = "createInstance"; doReturn(expected).when(SPY_bbInputSetup).getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId); doNothing().when(SPY_bbInputSetup).populateLookupKeyMapWithIds(executeBB.getWorkflowResourceIds(), lookupKeyMap); boolean aLaCarte = true; GeneralBuildingBlock actual = SPY_bbInputSetup.getGBB(executeBB, lookupKeyMap, requestAction, aLaCarte, resourceId, null); assertThat(actual, sameBeanAs(expected)); }