### Question:
BBInputSetup implements JavaDelegate { protected GeneralBuildingBlock getGBBMacro(ExecuteBuildingBlock executeBB, RequestDetails requestDetails, Map<ResourceKey, String> lookupKeyMap, String requestAction, String resourceId, String vnfType) throws Exception { String bbName = executeBB.getBuildingBlock().getBpmnFlowName(); String key = executeBB.getBuildingBlock().getKey(); if (requestAction.equalsIgnoreCase("deleteInstance") || requestAction.equalsIgnoreCase("unassignInstance") || requestAction.equalsIgnoreCase("activateInstance") || requestAction.equalsIgnoreCase("activateFabricConfiguration") || requestAction.equalsIgnoreCase("recreateInstance") || requestAction.equalsIgnoreCase("replaceInstance")) { return getGBBMacroExistingService(executeBB, lookupKeyMap, bbName, requestAction, requestDetails.getCloudConfiguration()); } String serviceInstanceId = lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID); GeneralBuildingBlock gBB = this.getGBBALaCarteService(executeBB, requestDetails, lookupKeyMap, requestAction, serviceInstanceId); RequestParameters requestParams = requestDetails.getRequestParameters(); Service service = null; if (gBB != null && gBB.getServiceInstance() != null && gBB.getServiceInstance().getModelInfoServiceInstance() != null && gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid() != null) { service = bbInputSetupUtils.getCatalogServiceByModelUUID( gBB.getServiceInstance().getModelInfoServiceInstance().getModelUuid()); } else { throw new Exception("Could not get service instance for macro request"); } if (requestParams != null && requestParams.getUserParams() != null) { for (Map<String, Object> userParams : requestParams.getUserParams()) { if (userParams.containsKey("service")) { String input = mapper.writeValueAsString(userParams.get("service")); return getGBBMacroUserParams(executeBB, requestDetails, lookupKeyMap, vnfType, bbName, key, gBB, requestParams, service, input); } } } if (requestAction.equalsIgnoreCase("deactivateInstance")) { return gBB; } else if (requestAction.equalsIgnoreCase("createInstance")) { return getGBBMacroNoUserParamsCreate(executeBB, lookupKeyMap, bbName, key, gBB, service); } else { throw new IllegalArgumentException( "No user params on requestAction: assignInstance. Please specify user params."); } }  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(expected = Exception.class) public void testgetGBBMacroException() throws Exception { ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"), ExecuteBuildingBlock.class); RequestDetails requestDetails = mapper .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); String resourceId = "123"; String vnfType = "vnfType"; String requestAction = "createInstance"; BuildingBlock buildingBlock = executeBB.getBuildingBlock(); buildingBlock.setBpmnFlowName("Network").setKey("ab153b6e-c364-44c0-bef6-1f2982117f04"); SPY_bbInputSetup.getGBBMacro(executeBB, requestDetails, lookupKeyMap, requestAction, resourceId, vnfType); }