test_class.declarator: PROJECT_BOARD_URL = "http://localhost:4200/"
test_class.modifier: private static final
test_class.original_string: private static final String PROJECT_BOARD_URL = "http://localhost:4200/";
test_class.type: String
test_class.var_name: PROJECT_BOARD_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: configurationPropertiesMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectBoardConfigurationProperties configurationPropertiesMock;
test_class.type: ProjectBoardConfigurationProperties
test_class.var_name: configurationPropertiesMock
test_class.declarator: userMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private User userMock;
test_class.type: User
test_class.var_name: userMock
test_class.declarator: userDataMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserData userDataMock;
test_class.type: UserData
test_class.var_name: userDataMock
test_class.declarator: accessIntervalMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AccessInterval accessIntervalMock;
test_class.type: AccessInterval
test_class.var_name: accessIntervalMock
test_class.declarator: mailUserAccessEventHandler
test_class.modifier: private
test_class.original_string: private MailUserAccessEventHandler mailUserAccessEventHandler;
test_class.type: MailUserAccessEventHandler
test_class.var_name: mailUserAccessEventHandler
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/adapter/mail/handler/MailUserAccessEventHandlerTest.java
test_class.identifier: MailUserAccessEventHandlerTest
test_case.body: @Test
      public void onAccessChangedQueuesExtendedMessageWhenNewEndAfterOldEnd() {
          // given
          var expectedTemplatePath = "/templates/mail/UserAccessExtended.vm";
          var expectedSubject = "Subject!";
          var expectedText = "Text!";
          var expectedEndTime = LocalDateTime.of(2019, 2, 3, 10, 0);
          var expectedOldEndTime = LocalDateTime.of(2019, 1, 1, 10, 0);
          var expectedContextMap = Map.of(
                  "userData", userDataMock,
                  "newDate", expectedEndTime.format(MailUserAccessEventHandler.DATE_TIME_FORMATTER),
                  "projectBoardUrl", PROJECT_BOARD_URL
          );
          var expectedMessage = new TimeAwareMessage(userMock, userMock, expectedSubject, expectedText, expectedEndTime);
          var subjectTextPair = new Pair<>(expectedSubject, expectedText);
  
          given(accessIntervalMock.getEndTime()).willReturn(expectedEndTime);
          given(userServiceMock.getUserData(userMock)).willReturn(userDataMock);
  
          given(velocityMailTemplateServiceMock.getSubjectAndText(expectedTemplatePath, expectedContextMap))
                  .willReturn(subjectTextPair);
  
          // when
          mailUserAccessEventHandler.onAccessChanged(userMock, accessIntervalMock, expectedOldEndTime);
  
          // then
          verify(mailSenderAdapterMock).queueMessage(expectedMessage);
      }
test_case.class_method_signature: MailUserAccessEventHandlerTest.onAccessChangedQueuesExtendedMessageWhenNewEndAfterOldEnd()
test_case.full_signature: @Test public void onAccessChangedQueuesExtendedMessageWhenNewEndAfterOldEnd()
test_case.identifier: onAccessChangedQueuesExtendedMessageWhenNewEndAfterOldEnd
test_case.invocations: of of of format willReturn given getEndTime willReturn given getUserData willReturn given getSubjectAndText onAccessChanged queueMessage verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onAccessChangedQueuesExtendedMessageWhenNewEndAfterOldEnd()
focal_class.declarator: DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy")
focal_class.modifier: static final
focal_class.original_string: static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy");
focal_class.type: DateTimeFormatter
focal_class.var_name: DATE_TIME_FORMATTER
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: projectBoardUrl
focal_class.modifier: private final
focal_class.original_string: private final String projectBoardUrl;
focal_class.type: String
focal_class.var_name: projectBoardUrl
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/adapter/mail/handler/MailUserAccessEventHandler.java
focal_class.identifier: MailUserAccessEventHandler
focal_class.interfaces: implements UserAccessEventHandler
focal_class.class_method_signature: MailUserAccessEventHandler.MailUserAccessEventHandler(MailSenderAdapter mailSenderAdapter,
                                        UserService userService,
                                        VelocityMailTemplateService velocityMailTemplateService,
                                        ProjectBoardConfigurationProperties configurationProperties)
focal_class.full_signature: public  MailUserAccessEventHandler(MailSenderAdapter mailSenderAdapter,
                                        UserService userService,
                                        VelocityMailTemplateService velocityMailTemplateService,
                                        ProjectBoardConfigurationProperties configurationProperties)
focal_class.identifier: MailUserAccessEventHandler
focal_class.modifiers: public
focal_class.parameters: (MailSenderAdapter mailSenderAdapter,
                                        UserService userService,
                                        VelocityMailTemplateService velocityMailTemplateService,
                                        ProjectBoardConfigurationProperties configurationProperties)
focal_class.signature:  MailUserAccessEventHandler(MailSenderAdapter mailSenderAdapter,
                                        UserService userService,
                                        VelocityMailTemplateService velocityMailTemplateService,
                                        ProjectBoardConfigurationProperties configurationProperties)
focal_class.class_method_signature: MailUserAccessEventHandler.onAccessCreated(User user, AccessInterval accessInterval)
focal_class.full_signature: @Override public void onAccessCreated(User user, AccessInterval accessInterval)
focal_class.identifier: onAccessCreated
focal_class.modifiers: @Override public
focal_class.parameters: (User user, AccessInterval accessInterval)
focal_class.return: void
focal_class.signature: void onAccessCreated(User user, AccessInterval accessInterval)
focal_class.class_method_signature: MailUserAccessEventHandler.onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_class.full_signature: @Override public void onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_class.identifier: onAccessChanged
focal_class.modifiers: @Override public
focal_class.parameters: (User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_class.return: void
focal_class.signature: void onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_class.class_method_signature: MailUserAccessEventHandler.onAccessRevoked(User user, LocalDateTime previousEndTime)
focal_class.full_signature: @Override public void onAccessRevoked(User user, LocalDateTime previousEndTime)
focal_class.identifier: onAccessRevoked
focal_class.modifiers: @Override public
focal_class.parameters: (User user, LocalDateTime previousEndTime)
focal_class.return: void
focal_class.signature: void onAccessRevoked(User user, LocalDateTime previousEndTime)
focal_class.class_method_signature: MailUserAccessEventHandler.getContextMap(User user, LocalDateTime newEndTime)
focal_class.full_signature:  Map<String, Object> getContextMap(User user, LocalDateTime newEndTime)
focal_class.identifier: getContextMap
focal_class.parameters: (User user, LocalDateTime newEndTime)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getContextMap(User user, LocalDateTime newEndTime)
focal_class.class_method_signature: MailUserAccessEventHandler.getTemplatePathAccessChanged(LocalDateTime newEndTime, LocalDateTime previousEndTime)
focal_class.full_signature:  String getTemplatePathAccessChanged(LocalDateTime newEndTime, LocalDateTime previousEndTime)
focal_class.identifier: getTemplatePathAccessChanged
focal_class.parameters: (LocalDateTime newEndTime, LocalDateTime previousEndTime)
focal_class.return: String
focal_class.signature: String getTemplatePathAccessChanged(LocalDateTime newEndTime, LocalDateTime previousEndTime)
focal_method.body: @Override
      public void onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime) {
          if(!accessInterval.getEndTime().equals(previousEndTime)) {
              var contextMap = getContextMap(user, accessInterval.getEndTime());
              var templatePath = getTemplatePathAccessChanged(accessInterval.getEndTime(), previousEndTime);
  
              var subjectTextPair = velocityMailTemplateService.getSubjectAndText(templatePath, contextMap);
              var message = new TimeAwareMessage(user, user, subjectTextPair.getFirst(),
                      subjectTextPair.getSecond(), accessInterval.getEndTime());
              mailSenderAdapter.queueMessage(message);
          }
      }
focal_method.class_method_signature: MailUserAccessEventHandler.onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_method.full_signature: @Override public void onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_method.identifier: onAccessChanged
focal_method.invocations: equals getEndTime getContextMap getEndTime getTemplatePathAccessChanged getEndTime getSubjectAndText getFirst getSecond getEndTime queueMessage
focal_method.modifiers: @Override public
focal_method.parameters: (User user, AccessInterval accessInterval, LocalDateTime previousEndTime)
focal_method.return: void
focal_method.signature: void onAccessChanged(User user, AccessInterval accessInterval, LocalDateTime previousEndTime)