test_class.declarator: JIRA_ISSUE_URL = "https://jira.com/issues/"
test_class.modifier: private static final
test_class.original_string: private static final String JIRA_ISSUE_URL = "https://jira.com/issues/";
test_class.type: String
test_class.var_name: JIRA_ISSUE_URL
test_class.declarator: mailSenderAdapterMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MailSenderAdapter mailSenderAdapterMock;
test_class.type: MailSenderAdapter
test_class.var_name: mailSenderAdapterMock
test_class.declarator: userServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserService userServiceMock;
test_class.type: UserService
test_class.var_name: userServiceMock
test_class.declarator: velocityMailTemplateServiceMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private VelocityMailTemplateService velocityMailTemplateServiceMock;
test_class.type: VelocityMailTemplateService
test_class.var_name: velocityMailTemplateServiceMock
test_class.declarator: mailConfigPropertiesMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MailConfigurationProperties mailConfigPropertiesMock;
test_class.type: MailConfigurationProperties
test_class.var_name: mailConfigPropertiesMock
test_class.declarator: projectApplicationMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectApplication projectApplicationMock;
test_class.type: ProjectApplication
test_class.var_name: projectApplicationMock
test_class.declarator: applicantUserMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User applicantUserMock;
test_class.type: User
test_class.var_name: applicantUserMock
test_class.declarator: managerUserMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User managerUserMock;
test_class.type: User
test_class.var_name: managerUserMock
test_class.declarator: applicantDataMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserData applicantDataMock;
test_class.type: UserData
test_class.var_name: applicantDataMock
test_class.declarator: managerDataMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserData managerDataMock;
test_class.type: UserData
test_class.var_name: managerDataMock
test_class.declarator: projectMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Project projectMock;
test_class.type: Project
test_class.var_name: projectMock
test_class.declarator: mailProjectApplicationEventHandler
test_class.modifier: private
test_class.original_string: private MailProjectApplicationEventHandler mailProjectApplicationEventHandler;
test_class.type: MailProjectApplicationEventHandler
test_class.var_name: mailProjectApplicationEventHandler
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/adapter/mail/handler/MailProjectApplicationEventHandlerTest.java
test_class.identifier: MailProjectApplicationEventHandlerTest
test_case.body: @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);
      }
test_case.class_method_signature: MailProjectApplicationEventHandlerTest.onApplicationReceivedQueuesExpectedMessage()
test_case.full_signature: @Test public void onApplicationReceivedQueuesExpectedMessage()
test_case.identifier: onApplicationReceivedQueuesExpectedMessage
test_case.invocations: of willReturn given getUser willReturn given getProject willReturn given getId willReturn given getManagerOfUser willReturn given getUserData willReturn given getUserData willReturn given getSubjectAndText onApplicationReceived queueMessage verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onApplicationReceivedQueuesExpectedMessage()
focal_class.declarator: mailSenderAdapter
focal_class.modifier: private final
focal_class.original_string: private final MailSenderAdapter mailSenderAdapter;
focal_class.type: MailSenderAdapter
focal_class.var_name: mailSenderAdapter
focal_class.declarator: userService
focal_class.modifier: private final
focal_class.original_string: private final UserService userService;
focal_class.type: UserService
focal_class.var_name: userService
focal_class.declarator: velocityMailTemplateService
focal_class.modifier: private final
focal_class.original_string: private final VelocityMailTemplateService velocityMailTemplateService;
focal_class.type: VelocityMailTemplateService
focal_class.var_name: velocityMailTemplateService
focal_class.declarator: referralBaseUrl
focal_class.modifier: private final
focal_class.original_string: private final String referralBaseUrl;
focal_class.type: String
focal_class.var_name: referralBaseUrl
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/adapter/mail/handler/MailProjectApplicationEventHandler.java
focal_class.identifier: MailProjectApplicationEventHandler
focal_class.interfaces: implements ProjectApplicationEventHandler
focal_class.class_method_signature: MailProjectApplicationEventHandler.MailProjectApplicationEventHandler(MailSenderAdapter mailSenderAdapter,
                                                UserService userService,
                                                VelocityMailTemplateService velocityMailTemplateService,
                                                MailConfigurationProperties mailConfigProperties)
focal_class.full_signature: public  MailProjectApplicationEventHandler(MailSenderAdapter mailSenderAdapter,
                                                UserService userService,
                                                VelocityMailTemplateService velocityMailTemplateService,
                                                MailConfigurationProperties mailConfigProperties)
focal_class.identifier: MailProjectApplicationEventHandler
focal_class.modifiers: public
focal_class.parameters: (MailSenderAdapter mailSenderAdapter,
                                                UserService userService,
                                                VelocityMailTemplateService velocityMailTemplateService,
                                                MailConfigurationProperties mailConfigProperties)
focal_class.signature:  MailProjectApplicationEventHandler(MailSenderAdapter mailSenderAdapter,
                                                UserService userService,
                                                VelocityMailTemplateService velocityMailTemplateService,
                                                MailConfigurationProperties mailConfigProperties)
focal_class.class_method_signature: MailProjectApplicationEventHandler.onApplicationReceived(ProjectApplication application)
focal_class.full_signature: @Override public void onApplicationReceived(ProjectApplication application)
focal_class.identifier: onApplicationReceived
focal_class.modifiers: @Override public
focal_class.parameters: (ProjectApplication application)
focal_class.return: void
focal_class.signature: void onApplicationReceived(ProjectApplication application)
focal_method.body: @Override
      public void onApplicationReceived(ProjectApplication application) {
          var applicant = application.getUser();
          var manager = userService.getManagerOfUser(applicant);
          var applicantData = userService.getUserData(applicant);
          var managerData = userService.getUserData(manager);
          var issueLink = referralBaseUrl + application.getProject().getId();
  
          var contextMap = Map.of(
              "projectApplication", application,
              "applicantData", applicantData,
                  "managerData", managerData,
                  "issueLink", issueLink
          );
          var subjectTextPair = velocityMailTemplateService.getSubjectAndText("/templates/mail/UserAppliedForProject.vm", contextMap);
  
          var simpleMessage = new SimpleMessage(applicant, manager, subjectTextPair.getFirst(), subjectTextPair.getSecond());
          mailSenderAdapter.queueMessage(simpleMessage);
      }
focal_method.class_method_signature: MailProjectApplicationEventHandler.onApplicationReceived(ProjectApplication application)
focal_method.full_signature: @Override public void onApplicationReceived(ProjectApplication application)
focal_method.identifier: onApplicationReceived
focal_method.invocations: getUser getManagerOfUser getUserData getUserData getId getProject of getSubjectAndText getFirst getSecond queueMessage
focal_method.modifiers: @Override public
focal_method.parameters: (ProjectApplication application)
focal_method.return: void
focal_method.signature: void onApplicationReceived(ProjectApplication application)