BusinessObjectDefinitionSubjectMatterExpertRestController extends HerdBaseController { @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_BY_BUSINESS_OBJECT_DEFINITION_GET) public BusinessObjectDefinitionSubjectMatterExpertKeys getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition( @PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName) { return businessObjectDefinitionSubjectMatterExpertService.getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition( new BusinessObjectDefinitionKey(namespace, businessObjectDefinitionName)); }  @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_POST) BusinessObjectDefinitionSubjectMatterExpert createBusinessObjectDefinitionSubjectMatterExpert(
        @RequestBody BusinessObjectDefinitionSubjectMatterExpertCreateRequest request); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}" + "/userIds/{userId}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_DELETE) BusinessObjectDefinitionSubjectMatterExpert deleteBusinessObjectDefinitionSubjectMatterExpert(@PathVariable("namespace") String namespace,
        @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName, @PathVariable("userId") String userId); @RequestMapping(value = BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_URI_PREFIX + "/namespaces/{namespace}" + "/businessObjectDefinitionNames/{businessObjectDefinitionName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_BY_BUSINESS_OBJECT_DEFINITION_GET) BusinessObjectDefinitionSubjectMatterExpertKeys getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(
        @PathVariable("namespace") String namespace, @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName); static final String BUSINESS_OBJECT_DEFINITION_SUBJECT_MATTER_EXPERTS_URI_PREFIX; }
@Test public void testGetBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition() throws Exception { List<BusinessObjectDefinitionSubjectMatterExpertKey> keys = Arrays .asList(new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID_2), new BusinessObjectDefinitionSubjectMatterExpertKey(BDEF_NAMESPACE, BDEF_NAME, USER_ID)); BusinessObjectDefinitionKey businessObjectDefinitionKey = new BusinessObjectDefinitionKey(BDEF_NAMESPACE, BDEF_NAME); BusinessObjectDefinitionSubjectMatterExpertKeys businessObjectDefinitionSubjectMatterExpertKeys = new BusinessObjectDefinitionSubjectMatterExpertKeys(keys); when(businessObjectDefinitionSubjectMatterExpertService .getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(businessObjectDefinitionKey)) .thenReturn(businessObjectDefinitionSubjectMatterExpertKeys); BusinessObjectDefinitionSubjectMatterExpertKeys resultBusinessObjectDefinitionSubjectMatterExperts = businessObjectDefinitionSubjectMatterExpertRestController .getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(BDEF_NAMESPACE, BDEF_NAME); verify(businessObjectDefinitionSubjectMatterExpertService) .getBusinessObjectDefinitionSubjectMatterExpertsByBusinessObjectDefinition(businessObjectDefinitionKey); verifyNoMoreInteractions(businessObjectDefinitionSubjectMatterExpertService); assertEquals(businessObjectDefinitionSubjectMatterExpertKeys, resultBusinessObjectDefinitionSubjectMatterExperts); }