@Test
public void testGetSubjectMatterExpert() throws Exception
{

    // Create a subject matter expert key.
    SubjectMatterExpertKey originalSubjectMatterExpertKey = new SubjectMatterExpertKey(USER_ID);
    SubjectMatterExpertKey updatedSubjectMatterExpertKey = new SubjectMatterExpertKey(USER_ID_2);
    // Create subject matter expert contact details initialised with test data.
    SubjectMatterExpertContactDetails subjectMatterExpertContactDetails =
        new SubjectMatterExpertContactDetails(USER_FULL_NAME, USER_JOB_TITLE, USER_EMAIL_ADDRESS, USER_TELEPHONE_NUMBER);
    // Mock the external calls.
    when(alternateKeyHelper.validateStringParameter("user id", USER_ID)).thenReturn(USER_ID_2);
    when(subjectMatterExpertDao.getSubjectMatterExpertByKey(updatedSubjectMatterExpertKey)).thenReturn(subjectMatterExpertContactDetails);
    // Call the method under test.
    SubjectMatterExpert result = subjectMatterExpertServiceImpl.getSubjectMatterExpert(originalSubjectMatterExpertKey);
    // Validate the results.
    assertEquals(new SubjectMatterExpert(updatedSubjectMatterExpertKey, subjectMatterExpertContactDetails), result);
    // Verify the external calls.
    verify(alternateKeyHelper).validateStringParameter("user id", USER_ID);
    verify(subjectMatterExpertDao).getSubjectMatterExpertByKey(updatedSubjectMatterExpertKey);
    verifyNoMoreInteractionsHelper();
}