File tree Expand file tree Collapse file tree
src/test/java/it/aboutbits/springboot/emailservice/lib/application Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import it .aboutbits .springboot .emailservice .lib .exception .EmailException ;
77import it .aboutbits .springboot .emailservice .support .database .WithPostgres ;
88import jakarta .mail .internet .MimeMessage ;
9+ import org .junit .jupiter .api .BeforeEach ;
910import org .junit .jupiter .api .Test ;
1011import org .springframework .beans .factory .annotation .Autowired ;
1112import org .springframework .boot .test .context .SpringBootTest ;
2122import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
2223import static org .mockito .ArgumentMatchers .any ;
2324import static org .mockito .ArgumentMatchers .anyLong ;
25+ import static org .mockito .Mockito .doNothing ;
2426import static org .mockito .Mockito .doThrow ;
2527import static org .mockito .Mockito .times ;
2628import static org .mockito .Mockito .verify ;
@@ -38,6 +40,11 @@ class ManageEmailTest {
3840 @ Autowired
3941 private ManageEmail manageEmail ;
4042
43+ @ BeforeEach
44+ void setup () {
45+ doNothing ().when (javaMailSender ).send (any (MimeMessage .class ));
46+ }
47+
4148 @ Test
4249 void givenRequiredParameters_schedule_shouldCreateNewNotification () throws EmailException {
4350 var parameter = getValidParameterWithoutAttachment ();
You can’t perform that action at this time.
0 commit comments