test_class.declarator: messageRepositoryMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MessageRepository messageRepositoryMock;
test_class.type: MessageRepository
test_class.var_name: messageRepositoryMock
test_class.declarator: javaMailSenderMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private JavaMailSenderImpl javaMailSenderMock;
test_class.type: JavaMailSenderImpl
test_class.var_name: javaMailSenderMock
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: mailPropertiesMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MailConfigurationProperties mailPropertiesMock;
test_class.type: MailConfigurationProperties
test_class.var_name: mailPropertiesMock
test_class.declarator: templateMessageMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TemplateMessage templateMessageMock;
test_class.type: TemplateMessage
test_class.var_name: templateMessageMock
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: clock
test_class.modifier: private
test_class.original_string: private Clock clock;
test_class.type: Clock
test_class.var_name: clock
test_class.declarator: mailSenderAdapter
test_class.modifier: private
test_class.original_string: private MailSenderAdapter mailSenderAdapter;
test_class.type: MailSenderAdapter
test_class.var_name: mailSenderAdapter
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/adapter/mail/MailSenderAdapterTest.java
test_class.identifier: MailSenderAdapterTest
test_case.body: @Test
      public void sendMessage() {
          // given
          var expectedFrom = "sender@test.com";
          var expectedTo = "mail@googlemail.com";
          var expectedSubject = "This is a subject :-)";
          var expectedText = "This is a cool text and very long too!";
  
          var expectedSimpleMessage = new SimpleMailMessage();
          expectedSimpleMessage.setFrom(expectedFrom);
          expectedSimpleMessage.setTo(expectedTo);
          expectedSimpleMessage.setSubject(expectedSubject);
          expectedSimpleMessage.setText(expectedText);
  
          given(templateMessageMock.getSubject()).willReturn(expectedSubject);
          given(templateMessageMock.getText()).willReturn(expectedText);
          given(templateMessageMock.getAddressee()).willReturn(userMock);
  
          given(userServiceMock.getUserData(userMock)).willReturn(userDataMock);
          given(userDataMock.getEmail()).willReturn(expectedTo);
  
          given(mailPropertiesMock.getFromMail()).willReturn(expectedFrom);
  
          // when
          mailSenderAdapter.sendMessage(templateMessageMock);
  
          // then
          verify(javaMailSenderMock).send(expectedSimpleMessage);
      }
test_case.class_method_signature: MailSenderAdapterTest.sendMessage()
test_case.full_signature: @Test public void sendMessage()
test_case.identifier: sendMessage
test_case.invocations: setFrom setTo setSubject setText willReturn given getSubject willReturn given getText willReturn given getAddressee willReturn given getUserData willReturn given getEmail willReturn given getFromMail sendMessage send verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void sendMessage()
focal_class.declarator: messageRepository
focal_class.modifier: private final
focal_class.original_string: private final MessageRepository messageRepository;
focal_class.type: MessageRepository
focal_class.var_name: messageRepository
focal_class.declarator: mailSender
focal_class.modifier: private final
focal_class.original_string: private final JavaMailSender mailSender;
focal_class.type: JavaMailSender
focal_class.var_name: mailSender
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: properties
focal_class.modifier: private final
focal_class.original_string: private final MailConfigurationProperties properties;
focal_class.type: MailConfigurationProperties
focal_class.var_name: properties
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/adapter/mail/MailSenderAdapter.java
focal_class.identifier: MailSenderAdapter
focal_class.class_method_signature: MailSenderAdapter.MailSenderAdapter(MessageRepository messageRepository,
                               JavaMailSender mailSender,
                               UserService userService,
                               MailConfigurationProperties properties,
                               Clock clock)
focal_class.full_signature: public  MailSenderAdapter(MessageRepository messageRepository,
                               JavaMailSender mailSender,
                               UserService userService,
                               MailConfigurationProperties properties,
                               Clock clock)
focal_class.identifier: MailSenderAdapter
focal_class.modifiers: public
focal_class.parameters: (MessageRepository messageRepository,
                               JavaMailSender mailSender,
                               UserService userService,
                               MailConfigurationProperties properties,
                               Clock clock)
focal_class.signature:  MailSenderAdapter(MessageRepository messageRepository,
                               JavaMailSender mailSender,
                               UserService userService,
                               MailConfigurationProperties properties,
                               Clock clock)
focal_class.class_method_signature: MailSenderAdapter.sendPendingMessages()
focal_class.full_signature: @Scheduled(fixedDelay = 10000L) @Transactional public void sendPendingMessages()
focal_class.identifier: sendPendingMessages
focal_class.modifiers: @Scheduled(fixedDelay = 10000L) @Transactional public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void sendPendingMessages()
focal_class.class_method_signature: MailSenderAdapter.queueMessage(T message)
focal_class.full_signature: @Transactional public T queueMessage(T message)
focal_class.identifier: queueMessage
focal_class.modifiers: @Transactional public
focal_class.parameters: (T message)
focal_class.return: T
focal_class.signature: T queueMessage(T message)
focal_class.class_method_signature: MailSenderAdapter.sendMessage(TemplateMessage message)
focal_class.full_signature:  void sendMessage(TemplateMessage message)
focal_class.identifier: sendMessage
focal_class.parameters: (TemplateMessage message)
focal_class.return: void
focal_class.signature: void sendMessage(TemplateMessage message)
focal_method.body: void sendMessage(TemplateMessage message) {
          var addressee = message.getAddressee();
          var addresseeMail = userService.getUserData(addressee).getEmail();
  
          // create a new mail message, set the subject, text, addressee and send it
          var mailMessage = new SimpleMailMessage();
          mailMessage.setSubject(message.getSubject());
          mailMessage.setText(message.getText());
          mailMessage.setFrom(properties.getFromMail());
          mailMessage.setTo(addresseeMail);
  
          mailSender.send(mailMessage);
  
          log.info(String.format("Mail sent to %s!", addresseeMail));
      }
focal_method.class_method_signature: MailSenderAdapter.sendMessage(TemplateMessage message)
focal_method.full_signature:  void sendMessage(TemplateMessage message)
focal_method.identifier: sendMessage
focal_method.invocations: getAddressee getEmail getUserData setSubject getSubject setText getText setFrom getFromMail setTo send info format
focal_method.parameters: (TemplateMessage message)
focal_method.return: void
focal_method.signature: void sendMessage(TemplateMessage message)