Fix RatingCalculationAspectTest
@@ -9,7 +9,6 @@ import greencity.dto.user.UserVO;
import greencity.entity.RatingStatistics;
import greencity.entity.User;
import greencity.service.RatingStatisticsService;
-import greencity.service.UserService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
@@ -30,8 +29,8 @@ import static org.mockito.Mockito.when;
class RatingCalculationAspectTest {
@InjectMocks
RatingCalculationAspect ratingCalculationAspect;
- @Mock
- private UserService userService;
+// @Mock
+// private UserService userService;
@Mock
private RatingStatisticsService ratingStatisticsService;
@Mock
@@ -48,7 +47,7 @@ class RatingCalculationAspectTest {
@Test
void myAnnotationPointcut() {
ratingCalculationAspect = RatingCalculationAspect.builder()
- .userService(userService)
+// .userService(userService)
.modelMapper(modelMapper)
.restClient(restClient)
.ratingStatisticsService(ratingStatisticsService)
@@ -86,8 +85,8 @@ class RatingCalculationAspectTest {
when(authentication.getName()).thenReturn("email");
when(restClient.findByEmail("email")).thenReturn(userVO);
when(modelMapper.map(userVO, User.class)).thenReturn(user);
- when(modelMapper.map(user, UserVO.class)).thenReturn(userVO);
- when(userService.save(userVO)).thenReturn(userVO);
+// when(modelMapper.map(user, UserVO.class)).thenReturn(userVO);
+// when(userService.save(userVO)).thenReturn(userVO);
when(modelMapper.map(ratingStatistics, RatingStatisticsVO.class)).thenReturn(ratingStatisticsVO);
when(ratingStatisticsService.save(ratingStatisticsVO)).thenReturn(ratingStatisticsVO);
ratingCalculationAspectMock.myAnnotationPointcut(test);
