BusinessObjectFormatRestController extends HerdBaseController { @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}/" + "businessObjectFormatUsages/{businessObjectFormatUsage}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_ALL_GET) public BusinessObjectFormatKeys getBusinessObjectFormatsWithFilters(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage, @RequestParam(value = "latestBusinessObjectFormatVersion", required = false, defaultValue = "false") Boolean latestBusinessObjectFormatVersion) { return businessObjectFormatService .getBusinessObjectFormatsWithFilters(new BusinessObjectDefinitionKey(namespace, businessObjectDefinitionName), businessObjectFormatUsage, BooleanUtils.isTrue(latestBusinessObjectFormatVersion)); }  @RequestMapping(value = "/businessObjectFormats", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_POST) BusinessObjectFormat createBusinessObjectFormat(@RequestBody BusinessObjectFormatCreateRequest request); @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_PUT) BusinessObjectFormat updateBusinessObjectFormat(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @RequestBody BusinessObjectFormatUpdateRequest request); @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_GET) BusinessObjectFormat getBusinessObjectFormat(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @RequestParam(value = "businessObjectFormatVersion", required = false) Integer businessObjectFormatVersion); @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_DELETE) BusinessObjectFormat deleteBusinessObjectFormat(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion); @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_ALL_GET) BusinessObjectFormatKeys getBusinessObjectFormats(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @RequestParam(value = "latestBusinessObjectFormatVersion", required = false, defaultValue = "false") Boolean latestBusinessObjectFormatVersion); @RequestMapping(value = "/businessObjectFormats/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}/" + "businessObjectFormatUsages/{businessObjectFormatUsage}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_ALL_GET) BusinessObjectFormatKeys getBusinessObjectFormatsWithFilters(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @RequestParam(value = "latestBusinessObjectFormatVersion", required = false, defaultValue = "false") Boolean latestBusinessObjectFormatVersion); @RequestMapping(value = "/businessObjectFormats/generateDdl", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_GENERATE_DDL_POST) BusinessObjectFormatDdl generateBusinessObjectFormatDdl(@RequestBody BusinessObjectFormatDdlRequest businessObjectFormatDdlRequest); @RequestMapping(value = "/businessObjectFormats/generateDdlCollection", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMATS_GENERATE_DDL_COLLECTION_POST) BusinessObjectFormatDdlCollectionResponse generateBusinessObjectFormatDdlCollection(
        @RequestBody BusinessObjectFormatDdlCollectionRequest businessObjectFormatDdlCollectionRequest); @RequestMapping(value = "/businessObjectFormatParents/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMAT_PARENTS_PUT) BusinessObjectFormat updateBusinessObjectFormatParents(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType, @RequestBody BusinessObjectFormatParentsUpdateRequest request); @RequestMapping(value = "/businessObjectFormatAttributes/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMAT_ATTRIBUTES_PUT) BusinessObjectFormat updateBusinessObjectFormatAttributes(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @RequestBody BusinessObjectFormatAttributesUpdateRequest request); @RequestMapping(value = "/businessObjectFormatAttributeDefinitions/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}" + "/businessObjectFormatVersions/{businessObjectFormatVersion}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMAT_ATTRIBUTE_DEFINITIONS_PUT) BusinessObjectFormat updateBusinessObjectFormatAttributeDefinitions(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion,
        @RequestBody BusinessObjectFormatAttributeDefinitionsUpdateRequest request); @RequestMapping(value = "/businessObjectFormatRetentionInformation/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMAT_RETENTION_INFORMATION_PUT) BusinessObjectFormat updateBusinessObjectFormatRetentionInformation(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @RequestBody BusinessObjectFormatRetentionInformationUpdateRequest request); @RequestMapping(value = "/businessObjectFormatSchemaBackwardsCompatibility/namespaces/{namespace}/businessObjectDefinitionNames/" + "{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}/businessObjectFormatFileTypes/{businessObjectFormatFileType}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_FORMAT_SCHEMA_BACKWARDS_COMPATIBILITY_PUT) BusinessObjectFormat updateBusinessObjectFormatSchemaBackwardsCompatibleChanges(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
        @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
        @RequestBody BusinessObjectFormatSchemaBackwardsCompatibilityUpdateRequest request);  }
@Test public void testGetBusinessObjectFormatsWithFilters() { BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(NAMESPACE, BDEF_NAME); BusinessObjectFormatKeys businessObjectFormatKeys = new BusinessObjectFormatKeys(Arrays .asList(new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION, INITIAL_FORMAT_VERSION), new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME_2, BDEF_DESCRIPTION, INITIAL_FORMAT_VERSION))); when(businessObjectFormatService.getBusinessObjectFormatsWithFilters(businessObjectDefinitionKey, FORMAT_USAGE_CODE, false)) .thenReturn(businessObjectFormatKeys); BusinessObjectFormatKeys resultKeys = businessObjectFormatRestController.getBusinessObjectFormatsWithFilters(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, false); verify(businessObjectFormatService).getBusinessObjectFormatsWithFilters(businessObjectDefinitionKey, FORMAT_USAGE_CODE, false); verifyNoMoreInteractions(businessObjectFormatService); assertEquals(businessObjectFormatKeys, resultKeys); }