SubjectMatterExpertRestController extends HerdBaseController { @RequestMapping(value = SUBJECT_MATTER_EXPERTS_URI_PREFIX + "/{userId}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SUBJECT_MATTER_EXPERTS_GET) public SubjectMatterExpert getSubjectMatterExpert(@PathVariable("userId") String userId) { return subjectMatterExpertService.getSubjectMatterExpert(new SubjectMatterExpertKey(userId)); }  @RequestMapping(value = SUBJECT_MATTER_EXPERTS_URI_PREFIX + "/{userId}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_SUBJECT_MATTER_EXPERTS_GET) SubjectMatterExpert getSubjectMatterExpert(@PathVariable("userId") String userId); static final String SUBJECT_MATTER_EXPERTS_URI_PREFIX; }
@Test public void testGetSubjectMatterExpert() { SubjectMatterExpert subjectMatterExpert = new SubjectMatterExpert(new SubjectMatterExpertKey(USER_ID), new SubjectMatterExpertContactDetails(USER_FULL_NAME, USER_JOB_TITLE, USER_EMAIL_ADDRESS, USER_TELEPHONE_NUMBER)); when(subjectMatterExpertService.getSubjectMatterExpert(new SubjectMatterExpertKey(USER_ID))).thenReturn(subjectMatterExpert); SubjectMatterExpert result = subjectMatterExpertRestController.getSubjectMatterExpert(USER_ID); verify(subjectMatterExpertService).getSubjectMatterExpert(new SubjectMatterExpertKey(USER_ID)); verifyNoMoreInteractions(subjectMatterExpertService); assertEquals(subjectMatterExpert, result); }