BusinessObjectDefinitionColumnRestController extends HerdBaseController { @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectDefinitionColumnNames/{businessObjectDefinitionColumnName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_GET) public BusinessObjectDefinitionColumn getBusinessObjectDefinitionColumn(@PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("businessObjectDefinitionColumnName") String businessObjectDefinitionColumnName, @RequestParam(value = "includeBusinessObjectDefinitionColumnUpdateHistory", required = false) Boolean includeBusinessObjectDefinitionColumnUpdateHistory) { return businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumn( new BusinessObjectDefinitionColumnKey(namespace, businessObjectDefinitionName, businessObjectDefinitionColumnName), includeBusinessObjectDefinitionColumnUpdateHistory); }  @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_POST) BusinessObjectDefinitionColumn createBusinessObjectDefinitionColumn(@RequestBody BusinessObjectDefinitionColumnCreateRequest request); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectDefinitionColumnNames/{businessObjectDefinitionColumnName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_GET) BusinessObjectDefinitionColumn getBusinessObjectDefinitionColumn(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectDefinitionColumnName") String businessObjectDefinitionColumnName,
        @RequestParam(value = "includeBusinessObjectDefinitionColumnUpdateHistory", required = false)
            Boolean includeBusinessObjectDefinitionColumnUpdateHistory); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectDefinitionColumnNames/{businessObjectDefinitionColumnName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_PUT) BusinessObjectDefinitionColumn updateBusinessObjectDefinitionColumn(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectDefinitionColumnName") String businessObjectDefinitionColumnName,
        @RequestBody BusinessObjectDefinitionColumnUpdateRequest request); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/businessObjectDefinitionColumnNames/{businessObjectDefinitionColumnName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_DELETE) BusinessObjectDefinitionColumn deleteBusinessObjectDefinitionColumn(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
        @PathVariable("businessObjectDefinitionColumnName") String businessObjectDefinitionColumnName); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_ALL_GET) BusinessObjectDefinitionColumnKeys getBusinessObjectDefinitionColumns(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX + "/search", method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_COLUMNS_SEARCH_POST) BusinessObjectDefinitionColumnSearchResponse searchBusinessObjectDefinitionColumns(
        @RequestParam(value = "fields", required = false, defaultValue = "") Set<String> fields,
        @RequestBody BusinessObjectDefinitionColumnSearchRequest request); static final String BUSINESS_OBJECT_DEFINITION_COLUMNS_URI_PREFIX; }
@Test public void testGetBusinessObjectDefinitionColumn() { List<BusinessObjectDefinitionColumnChangeEvent> businessObjectDefinitionColumnChangeEvents = Lists.newArrayList(new BusinessObjectDefinitionColumnChangeEvent(BDEF_COLUMN_DESCRIPTION, CREATED_ON, CREATED_BY)); BusinessObjectDefinitionColumnKey businessObjectDefinitionColumnKey = new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME); BusinessObjectDefinitionColumn businessObjectDefinitionColumn = new BusinessObjectDefinitionColumn(ID, businessObjectDefinitionColumnKey, COLUMN_NAME, BDEF_COLUMN_DESCRIPTION, businessObjectDefinitionColumnChangeEvents); when(businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumn(businessObjectDefinitionColumnKey, false)) .thenReturn(businessObjectDefinitionColumn); BusinessObjectDefinitionColumn resultBusinessObjectDefinitionColumn = businessObjectDefinitionColumnRestController.getBusinessObjectDefinitionColumn(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME, false); verify(businessObjectDefinitionColumnService).getBusinessObjectDefinitionColumn(businessObjectDefinitionColumnKey, false); verifyNoMoreInteractions(businessObjectDefinitionColumnService); assertEquals(businessObjectDefinitionColumn, resultBusinessObjectDefinitionColumn); }
@Test public void testGetBusinessObjectDefinitionColumnWithUpdateHistory() { List<BusinessObjectDefinitionColumnChangeEvent> businessObjectDefinitionColumnChangeEvents = Lists.newArrayList(new BusinessObjectDefinitionColumnChangeEvent(BDEF_COLUMN_DESCRIPTION, CREATED_ON, CREATED_BY)); BusinessObjectDefinitionColumnKey businessObjectDefinitionColumnKey = new BusinessObjectDefinitionColumnKey(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME); BusinessObjectDefinitionColumn businessObjectDefinitionColumn = new BusinessObjectDefinitionColumn(ID, businessObjectDefinitionColumnKey, COLUMN_NAME, BDEF_COLUMN_DESCRIPTION, businessObjectDefinitionColumnChangeEvents); when(businessObjectDefinitionColumnService.getBusinessObjectDefinitionColumn(businessObjectDefinitionColumnKey, true)) .thenReturn(businessObjectDefinitionColumn); BusinessObjectDefinitionColumn resultBusinessObjectDefinitionColumn = businessObjectDefinitionColumnRestController.getBusinessObjectDefinitionColumn(BDEF_NAMESPACE, BDEF_NAME, BDEF_COLUMN_NAME, true); verify(businessObjectDefinitionColumnService).getBusinessObjectDefinitionColumn(businessObjectDefinitionColumnKey, true); verifyNoMoreInteractions(businessObjectDefinitionColumnService); assertEquals(businessObjectDefinitionColumn, resultBusinessObjectDefinitionColumn); }