[issue - 65] add MockitoJunitRunner,
@@ -11,24 +11,24 @@ import greencity.entity.enums.UserStatus;
import greencity.exception.BadEmailException;
import greencity.exception.BadIdException;
import greencity.repository.UserRepo;
-import greencity.service.UserService;
import java.time.LocalDateTime;
import java.util.Optional;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringRunner.class)
+@RunWith(MockitoJUnitRunner.class)
@SpringBootTest(classes = GreenCityApplication.class)
public class UserServiceImplTest {
- @MockBean
+
+ @Mock
UserRepo userRepo;
- @Autowired
- private UserService userService;
+ @InjectMocks
+ private UserServiceImpl userService;
@Test
public void saveTest() {
