Skip to content

Commit

Permalink
Merge pull request #3 from aboutbits/feature/init
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
SirCotare authored Oct 19, 2023
2 parents 0ca573c + b5424ee commit e9a6e16
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import it.aboutbits.springboot.emailservice.lib.exception.EmailException;
import it.aboutbits.springboot.emailservice.support.database.WithPostgres;
import jakarta.mail.internet.MimeMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -21,6 +22,7 @@
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand All @@ -38,6 +40,11 @@ class ManageEmailTest {
@Autowired
private ManageEmail manageEmail;

@BeforeEach
void setup() {
doNothing().when(javaMailSender).send(any(MimeMessage.class));
}

@Test
void givenRequiredParameters_schedule_shouldCreateNewNotification() throws EmailException {
var parameter = getValidParameterWithoutAttachment();
Expand Down

0 comments on commit e9a6e16

Please sign in to comment.