BusinessObjectDefinitionRestController extends HerdBaseController { @RequestMapping(value = "/businessObjectDefinitions", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_ALL_GET) public BusinessObjectDefinitionKeys getBusinessObjectDefinitions() { return businessObjectDefinitionService.getBusinessObjectDefinitions(); }  @RequestMapping(value = "/businessObjectDefinitions", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_POST) BusinessObjectDefinition createBusinessObjectDefinition(@RequestBody BusinessObjectDefinitionCreateRequest request); @RequestMapping(value = "/businessObjectDefinitions/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_PUT) BusinessObjectDefinition updateBusinessObjectDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @RequestBody BusinessObjectDefinitionUpdateRequest request); @RequestMapping( value = "/businessObjectDefinitionDescriptiveInformation/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_DESCRIPTIVE_INFO_PUT) BusinessObjectDefinition updateBusinessObjectDefinitionDescriptiveInformation(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @RequestBody BusinessObjectDefinitionDescriptiveInformationUpdateRequest request); @RequestMapping(value = "/businessObjectDefinitions/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_GET) BusinessObjectDefinition getBusinessObjectDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @RequestParam(value = "includeBusinessObjectDefinitionUpdateHistory", required = false) Boolean includeBusinessObjectDefinitionUpdateHistory); @RequestMapping(value = "/businessObjectDefinitions/namespaces/{namespace}/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_DELETE) BusinessObjectDefinition deleteBusinessObjectDefinition(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName); @RequestMapping(value = "/businessObjectDefinitions", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_ALL_GET) BusinessObjectDefinitionKeys getBusinessObjectDefinitions(); @RequestMapping(value = "/businessObjectDefinitions/namespaces/{namespace}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_ALL_GET) BusinessObjectDefinitionKeys getBusinessObjectDefinitions(@PathVariable("namespace") String namespace); @RequestMapping(value = "/businessObjectDefinitions/search", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITIONS_SEARCH_POST) BusinessObjectDefinitionSearchResponse searchBusinessObjectDefinitions(
        @RequestParam(value = "fields", required = false, defaultValue = "") Set<String> fields, @RequestBody BusinessObjectDefinitionSearchRequest request);  }
@Test public void testGetBusinessObjectDefinitions() { BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys(Arrays.asList(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME))); when(businessObjectDefinitionService.getBusinessObjectDefinitions()).thenReturn(businessObjectDefinitionKeys); BusinessObjectDefinitionKeys result = businessObjectDefinitionRestController.getBusinessObjectDefinitions(); verify(businessObjectDefinitionService).getBusinessObjectDefinitions(); verifyNoMoreInteractions(businessObjectDefinitionService); assertEquals(businessObjectDefinitionKeys, result); }
@Test public void testGetBusinessObjectDefinitionsByNamespace() { BusinessObjectDefinitionKeys businessObjectDefinitionKeys = new BusinessObjectDefinitionKeys(Arrays.asList(new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME))); when(businessObjectDefinitionService.getBusinessObjectDefinitions(BDEF_NAMESPACE)).thenReturn(businessObjectDefinitionKeys); BusinessObjectDefinitionKeys resultKeys = businessObjectDefinitionRestController.getBusinessObjectDefinitions(BDEF_NAMESPACE); verify(businessObjectDefinitionService).getBusinessObjectDefinitions(BDEF_NAMESPACE); verifyNoMoreInteractions(businessObjectDefinitionService); assertEquals(businessObjectDefinitionKeys, resultKeys); }