You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have made good use of Mockito in the tests, however it doesn't play well with GraalVM native image compilation. As part of adding Graal support in #2533 we had to exclude 22 of these tests from the nativeTest execution.
We should investigate how much of this mocking can be replaced with standard classes, or simply using the actual components after the database has been set up in the way we expect for the tests
The text was updated successfully, but these errors were encountered:
As part of investigating removing the mocking from the tests (for #2534), this switches from using a `mock(EmailSender)` to creating a bean under test which tracks the calls made to it in a simple list.
If the `replace.mailjet.factory` property is set in a test then the standard `MailJetFactory` is replaced by our factory.
This generates EmailSender instances (for HTML and TEXT) which track the calls to their methods in a list of strings.
We can also remove the `setEmailSender` methods which we had to use to force the mock bean into the running services.
I believe this has uncovered a bug in the Guild Service whereby too many emails are being sent.
(see `com.objectcomputing.checkins.services.guild.GuildControllerTest#testEmailSentToGuildLeadWhenGuildMembersAdded`)
I would have expected a single email, but we are sending 2... 🤔
We have made good use of Mockito in the tests, however it doesn't play well with GraalVM native image compilation. As part of adding Graal support in #2533 we had to exclude 22 of these tests from the
nativeTest
execution.We should investigate how much of this mocking can be replaced with standard classes, or simply using the actual components after the database has been set up in the way we expect for the tests
The text was updated successfully, but these errors were encountered: