-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change structure acheievements #6419
Conversation
@@ -9,7 +9,7 @@ | |||
import greencity.dto.PageableAdvancedDto; | |||
import greencity.dto.achievement.AchievementManagementDto; | |||
import greencity.dto.achievement.AchievementPostDto; | |||
import greencity.dto.achievement.AchievementTranslationVO; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this blank line
@@ -162,11 +162,10 @@ | |||
import greencity.entity.event.EventComment; | |||
import greencity.entity.event.EventDateLocation; | |||
import greencity.entity.event.EventGrade; | |||
import greencity.entity.localization.AchievementTranslation; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -454,7 +452,7 @@ public static UserVO getUserVOWithData() { | |||
.build(), | |||
UserAchievementVO.builder() | |||
.id(39L) | |||
.achievementStatus(AchievementStatus.INACTIVE) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -1379,48 +1377,44 @@ public static AdvicePostDto getAdvicePostDto() { | |||
} | |||
|
|||
public static Achievement getAchievement() { | |||
return new Achievement(1L, Collections.singletonList(getAchievementTranslation()), Collections.emptyList(), | |||
return new Achievement(1L, | |||
"CREATED_5_NEWS", "CREATED_5_NEWS", "CREATED_5_NEWS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not a good practice to use the same value for the different variables
} | ||
|
||
public static AchievementPostDto getAchievementPostDto() { | ||
return new AchievementPostDto(Collections.emptyList(), getAchievementCategoryDto(), 1); | ||
return new AchievementPostDto("CREATED_5_NEWS", "CREATED_5_NEWS", "CREATED_5_NEWS", getAchievementCategoryDto(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
} | ||
|
||
public static AchievementVO getAchievementVO() { | ||
return new AchievementVO(1L, Collections.emptyList(), Collections.emptyList(), new AchievementCategoryVO(), 1); | ||
return new AchievementVO(1L, "CREATED_5_NEWS", "CREATED_5_NEWS", "CREATED_5_NEWS", new AchievementCategoryVO(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -1698,7 +1692,7 @@ public static UserVO createUserVO2() { | |||
.userAchievements(List.of( | |||
UserAchievementVO.builder() | |||
.id(47L) | |||
.achievementStatus(AchievementStatus.ACTIVE) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove blank line
@@ -1708,7 +1702,7 @@ public static UserVO createUserVO2() { | |||
.build(), | |||
UserAchievementVO.builder() | |||
.id(39L) | |||
.achievementStatus(AchievementStatus.INACTIVE) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -1776,7 +1770,7 @@ public static UserVO createUserVO2() { | |||
.userAchievements(List.of( | |||
UserAchievementVO.builder() | |||
.id(47L) | |||
.achievementStatus(AchievementStatus.ACTIVE) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -1786,7 +1780,7 @@ public static UserVO createUserVO2() { | |||
.build(), | |||
UserAchievementVO.builder() | |||
.id(39L) | |||
.achievementStatus(AchievementStatus.INACTIVE) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
import greencity.entity.Language; | ||
import greencity.entity.UserAchievement; | ||
import greencity.entity.localization.AchievementTranslation; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove blank line
import greencity.enums.AchievementCategoryType; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
when(modelMapper.map(ecoNews, AddEcoNewsDtoResponse.class)).thenReturn(addEcoNewsDtoResponse); | ||
when(modelMapper.map(ModelUtils.getUserVO(), User.class)).thenReturn(ModelUtils.getUser()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add verify
@@ -178,7 +184,7 @@ void saveEcoNews() { | |||
when(modelMapper.map(tagVOList, | |||
new TypeToken<List<Tag>>() { | |||
}.getType())).thenReturn(tags); | |||
|
|||
when(userService.findByEmail(anyString())).thenReturn(ModelUtils.getUserVO()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Kudos, SonarCloud Quality Gate passed! 0 Bugs 100.0% Coverage The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
GreenCity PR
Update Achievement structure #6421
Summary Of Changes 🔥
Added new enum of achievements
Updated old implementation of achievement service
Added
New enum of achievements
Changed
Implementation of achievement service
Deleted
Unused methods and fields
PR Checklist Forms
(to be filled out by PR submitter)
dev
branch.NEED_REVIEW
andREADY_FOR_REVIEW
labels are added.