@Test
public void onApplicationReceivedQueuesExpectedMessage() {

    // given
    var projectId = "PB-2";
    var expectedTemplatePath = "/templates/mail/UserAppliedForProject.vm";
    var expectedSubject = "This is a subject :O";
    var expectedText = "Cool text :)";
    var subjectTextPair = new Pair<>(expectedSubject, expectedText);
    var expectedMessage = new SimpleMessage(applicantUserMock, managerUserMock, expectedSubject, expectedText);
    var jiraIssueLink = JIRA_ISSUE_URL + projectId;
    var expectedContextMap = Map.of(
            "projectApplication", projectApplicationMock,
            "applicantData", applicantDataMock,
            "managerData", managerDataMock,
            "issueLink", jiraIssueLink
    );
    given(projectApplicationMock.getUser()).willReturn(applicantUserMock);
    given(projectApplicationMock.getProject()).willReturn(projectMock);
    given(projectMock.getId()).willReturn(projectId);
    given(userServiceMock.getManagerOfUser(applicantUserMock)).willReturn(managerUserMock);
    given(userServiceMock.getUserData(applicantUserMock)).willReturn(applicantDataMock);
    given(userServiceMock.getUserData(managerUserMock)).willReturn(managerDataMock);
    given(velocityMailTemplateServiceMock.getSubjectAndText(expectedTemplatePath, expectedContextMap))
        .willReturn(subjectTextPair);
    // when
    mailProjectApplicationEventHandler.onApplicationReceived(projectApplicationMock);
    // then
    verify(mailSenderAdapterMock).queueMessage(expectedMessage);
}