Tests for EmailServiceImpl
package greencity.service.impl;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
-import greencity.GreenCityApplication;
import greencity.entity.Category;
import greencity.entity.Place;
import greencity.entity.User;
@@ -17,12 +17,10 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mail.javamail.JavaMailSender;
import org.thymeleaf.ITemplateEngine;
@RunWith(MockitoJUnitRunner.class)
-@SpringBootTest(classes = GreenCityApplication.class)
public class EmailServiceImplTest {
private EmailService service;
private User user;
@@ -61,4 +59,16 @@ public class EmailServiceImplTest {
verify(javaMailSender).createMimeMessage();
}
+
+ @Test
+ public void sendVerificationEmailTest() {
+ service.sendVerificationEmail(user, "");
+ verify(javaMailSender).createMimeMessage();
+ }
+
+ @Test
+ public void sendRestoreEmailTest() {
+ service.sendRestoreEmail(user, "");
+ verify(javaMailSender).createMimeMessage();
+ }
}
\ No newline at end of file
