BusinessObjectDataStatusRestController extends HerdBaseController { @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_GET) public BusinessObjectDataStatusInformation getBusinessObjectDataStatus(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage, @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType, @RequestParam(value = "partitionKey", required = false) String businessObjectFormatPartitionKey, @RequestParam("partitionValue") String partitionValue, @RequestParam(value = "subPartitionValues", required = false) String subPartitionValues, @RequestParam(value = "businessObjectFormatVersion", required = false) Integer businessObjectFormatVersion, @RequestParam(value = "businessObjectDataVersion", required = false) Integer businessObjectDataVersion) { return businessObjectDataStatusService.getBusinessObjectDataStatus( new BusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, partitionValue, herdStringHelper.splitStringWithDefaultDelimiterEscaped(subPartitionValues), businessObjectDataVersion), businessObjectFormatPartitionKey); }  @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_GET) BusinessObjectDataStatusInformation getBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @RequestParam(value = "partitionKey", required = false) String businessObjectFormatPartitionKey, @RequestParam("partitionValue") String partitionValue,
        @RequestParam(value = "subPartitionValues", required = false) String subPartitionValues,
        @RequestParam(value = "businessObjectFormatVersion", required = false) Integer businessObjectFormatVersion,
        @RequestParam(value = "businessObjectDataVersion", required = false) Integer businessObjectDataVersion); @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
        @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion, @RequestBody BusinessObjectDataStatusUpdateRequest request); @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
        @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion,
        @RequestBody BusinessObjectDataStatusUpdateRequest request); @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/subPartition2Values/{subPartition2Value}" + "/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
        @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("subPartition2Value") String subPartition2Value,
        @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion, @RequestBody BusinessObjectDataStatusUpdateRequest request); @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/subPartition2Values/{subPartition2Value}" + "/subPartition3Values/{subPartition3Value}/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
        @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("subPartition2Value") String subPartition2Value,
        @PathVariable("subPartition3Value") String subPartition3Value, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion,
        @RequestBody BusinessObjectDataStatusUpdateRequest request); @RequestMapping( value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" + "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" + "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/subPartition2Values/{subPartition2Value}" + "/subPartition3Values/{subPartition3Value}/subPartition4Values/{subPartition4Value}/businessObjectDataVersions/{businessObjectDataVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT) BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
        @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("subPartition2Value") String subPartition2Value,
        @PathVariable("subPartition3Value") String subPartition3Value, @PathVariable("subPartition4Value") String subPartition4Value,
        @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion, @RequestBody BusinessObjectDataStatusUpdateRequest request); static final String BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX; }
@Test public void testGetBusinessObjectDataStatus() { BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION); String delimitedSubPartitionValues = String.join("|", SUBPARTITION_VALUES); BusinessObjectDataStatusInformation businessObjectDataStatusInformation = new BusinessObjectDataStatusInformation(businessObjectDataKey, BDATA_STATUS); when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues)).thenReturn(SUBPARTITION_VALUES); when(businessObjectDataStatusService.getBusinessObjectDataStatus(businessObjectDataKey, PARTITION_KEY)).thenReturn(businessObjectDataStatusInformation); BusinessObjectDataStatusInformation result = businessObjectDataStatusRestController .getBusinessObjectDataStatus(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, PARTITION_KEY, PARTITION_VALUE, delimitedSubPartitionValues, FORMAT_VERSION, DATA_VERSION); verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues); verify(businessObjectDataStatusService).getBusinessObjectDataStatus(businessObjectDataKey, PARTITION_KEY); verifyNoMoreInteractionsHelper(); assertEquals(businessObjectDataStatusInformation, result); }
@Test public void testGetBusinessObjectDataStatusMissingOptionalParameters() { for (int i = 0; i <= BusinessObjectDataEntity.MAX_SUBPARTITIONS; i++) { List<String> subPartitionValues = SUBPARTITION_VALUES.subList(0, i); BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, PARTITION_VALUE, subPartitionValues, null); String delimitedSubPartitionValues = String.join("|", subPartitionValues); BusinessObjectDataStatusInformation businessObjectDataStatusInformation = new BusinessObjectDataStatusInformation(businessObjectDataKey, BDATA_STATUS); when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues)).thenReturn(subPartitionValues); when(businessObjectDataStatusService.getBusinessObjectDataStatus(businessObjectDataKey, BLANK_TEXT)) .thenReturn(businessObjectDataStatusInformation); BusinessObjectDataStatusInformation result = businessObjectDataStatusRestController .getBusinessObjectDataStatus(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, BLANK_TEXT, PARTITION_VALUE, delimitedSubPartitionValues, null, null); verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(delimitedSubPartitionValues); verify(businessObjectDataStatusService).getBusinessObjectDataStatus(businessObjectDataKey, BLANK_TEXT); verifyNoMoreInteractionsHelper(); assertEquals(businessObjectDataStatusInformation, result); } }
@Test public void testGetBusinessObjectDataStatusMissingOptionalParametersPassedAsNulls() { BusinessObjectDataStatusInformation businessObjectDataStatusInformation = new BusinessObjectDataStatusInformation(); BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, PARTITION_VALUE, new ArrayList<>(), null); when(herdStringHelper.splitStringWithDefaultDelimiterEscaped(null)).thenReturn(new ArrayList<>()); when(businessObjectDataStatusService.getBusinessObjectDataStatus(businessObjectDataKey, null)).thenReturn(businessObjectDataStatusInformation); BusinessObjectDataStatusInformation result = businessObjectDataStatusRestController .getBusinessObjectDataStatus(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, PARTITION_VALUE, null, null, null); verify(herdStringHelper).splitStringWithDefaultDelimiterEscaped(null); verify(businessObjectDataStatusService).getBusinessObjectDataStatus(businessObjectDataKey, null); verifyNoMoreInteractionsHelper(); assertEquals(businessObjectDataStatusInformation, result); }