Skip to content

Commit bd31c77

Browse files
committed
chore: sonarqube 이슈 해결
1 parent 599d59c commit bd31c77

File tree

8 files changed

+15
-48
lines changed

8 files changed

+15
-48
lines changed

src/main/java/com/somemore/domains/volunteerapply/controller/VolunteerApplyQueryApiController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.somemore.domains.volunteerapply.dto.response.VolunteerApplyWithReviewStatusResponseDto;
99
import com.somemore.domains.volunteerapply.usecase.VolunteerApplyQueryFacadeUseCase;
1010
import com.somemore.domains.volunteerapply.usecase.VolunteerApplyQueryUseCase;
11-
import com.somemore.global.auth.annotation.CurrentUser;
1211
import com.somemore.global.auth.annotation.RoleId;
1312
import com.somemore.global.common.response.ApiResponse;
1413
import com.somemore.global.exception.NoSuchElementException;

src/main/java/com/somemore/user/repository/usercommonattribute/UserCommonAttributeRepositoryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public List<UserCommonAttribute> findAllByUserIds(List<UUID> userIds) {
7373
return queryFactory
7474
.selectFrom(userCommonAttribute)
7575
.where(
76-
InUserIds(userIds),
76+
inUserIds(userIds),
7777
isNotDeleted())
7878
.fetch();
7979
}
@@ -86,7 +86,7 @@ private static BooleanExpression isNotDeleted() {
8686
return userCommonAttribute.deleted.eq(false);
8787
}
8888

89-
private static BooleanExpression InUserIds(List<UUID> userIds) {
89+
private static BooleanExpression inUserIds(List<UUID> userIds) {
9090
return userCommonAttribute.userId.in(userIds);
9191
}
9292

src/main/java/com/somemore/volunteer/repository/NEWVolunteerRepositoryImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public List<VolunteerNickname> findNicknamesByIds(List<UUID> ids) {
6161
volunteer.nickname))
6262
.from(volunteer)
6363
.where(
64-
InIds(ids),
64+
inIds(ids),
6565
isNotDeleted()
6666
)
6767
.fetch();
@@ -76,7 +76,7 @@ public List<VolunteerNicknameAndId> findVolunteerNicknameAndIdsByIds(List<UUID>
7676
volunteer.nickname))
7777
.from(volunteer)
7878
.where(
79-
InIds(ids),
79+
inIds(ids),
8080
isNotDeleted()
8181
)
8282
.fetch();
@@ -86,7 +86,7 @@ private static BooleanExpression isNotDeleted() {
8686
return volunteer.deleted.eq(false);
8787
}
8888

89-
private static BooleanExpression InIds(List<UUID> ids) {
89+
private static BooleanExpression inIds(List<UUID> ids) {
9090
return volunteer.id.in(ids);
9191
}
9292
}

src/test/java/com/somemore/domains/volunteer/repository/VolunteerRepositoryImplTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.somemore.domains.volunteer.repository;
22

33
import com.somemore.domains.volunteer.domain.Volunteer;
4-
import com.somemore.domains.volunteer.dto.request.VolunteerRegisterRequestDto;
54
import com.somemore.domains.volunteer.repository.mapper.VolunteerOverviewForRankingByHours;
65
import com.somemore.support.IntegrationTestSupport;
76
import org.assertj.core.api.AssertionsForClassTypes;
@@ -187,10 +186,4 @@ private void createVolunteerAndUpdateVolunteerStats(int i) {
187186
volunteerRepository.save(volunteer);
188187
}
189188

190-
private static VolunteerRegisterRequestDto createVolunteerRegisterRequestDto(String name) {
191-
return new VolunteerRegisterRequestDto(
192-
NAVER, "naver", name, "email", "M", "1111", "1111",
193-
"010-0000-0000");
194-
}
195-
196189
}

src/test/java/com/somemore/domains/volunteer/service/VolunteerQueryServiceTest.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.somemore.domains.volunteer.service;
22

33
import com.somemore.domains.volunteer.domain.Volunteer;
4-
import com.somemore.domains.volunteer.domain.VolunteerDetail;
5-
import com.somemore.domains.volunteer.dto.request.VolunteerRegisterRequestDto;
64
import com.somemore.domains.volunteer.dto.response.VolunteerRankingResponseDto;
75
import com.somemore.domains.volunteer.repository.VolunteerRepository;
86
import com.somemore.global.auth.oauth.domain.OAuthProvider;
@@ -178,21 +176,4 @@ void validateNonExistentVolunteer() {
178176
assertEquals(NOT_EXISTS_VOLUNTEER.getMessage(), exception.getMessage());
179177
}
180178

181-
private static VolunteerDetail createVolunteerDetail(UUID volunteerId) {
182-
183-
VolunteerRegisterRequestDto volunteerRegisterRequestDto =
184-
new VolunteerRegisterRequestDto(
185-
OAuthProvider.NAVER,
186-
"example-oauth-id",
187-
"making",
188-
189-
"male",
190-
"06-08",
191-
"1998",
192-
"010-1234-5678"
193-
);
194-
195-
return VolunteerDetail.of(volunteerRegisterRequestDto, volunteerId);
196-
}
197-
198179
}

src/test/java/com/somemore/domains/volunteerapply/service/VolunteerApplyQueryFacadeServiceTest.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
package com.somemore.domains.volunteerapply.service;
22

3-
import static com.somemore.domains.volunteerapply.domain.ApplyStatus.APPROVED;
4-
import static com.somemore.global.auth.oauth.domain.OAuthProvider.NAVER;
5-
import static com.somemore.support.fixture.RecruitBoardFixture.createRecruitBoard;
6-
import static org.assertj.core.api.Assertions.assertThat;
7-
83
import com.somemore.domains.recruitboard.domain.RecruitBoard;
94
import com.somemore.domains.recruitboard.repository.RecruitBoardRepository;
105
import com.somemore.domains.review.domain.Review;
116
import com.somemore.domains.review.repository.ReviewRepository;
12-
import com.somemore.domains.volunteer.domain.Volunteer;
13-
import com.somemore.domains.volunteer.domain.VolunteerDetail;
14-
import com.somemore.domains.volunteer.dto.request.VolunteerRegisterRequestDto;
15-
import com.somemore.domains.volunteer.repository.VolunteerDetailRepository;
16-
import com.somemore.domains.volunteer.repository.VolunteerRepository;
177
import com.somemore.domains.volunteerapply.domain.VolunteerApply;
188
import com.somemore.domains.volunteerapply.dto.condition.VolunteerApplySearchCondition;
199
import com.somemore.domains.volunteerapply.dto.response.VolunteerApplyRecruitInfoResponseDto;
2010
import com.somemore.domains.volunteerapply.dto.response.VolunteerApplyVolunteerInfoResponseDto;
2111
import com.somemore.domains.volunteerapply.dto.response.VolunteerApplyWithReviewStatusResponseDto;
2212
import com.somemore.domains.volunteerapply.repository.VolunteerApplyRepository;
2313
import com.somemore.support.IntegrationTestSupport;
24-
import java.util.List;
25-
import java.util.UUID;
26-
2714
import com.somemore.user.domain.UserCommonAttribute;
2815
import com.somemore.user.domain.UserRole;
2916
import com.somemore.user.repository.usercommonattribute.UserCommonAttributeRepository;
@@ -37,6 +24,13 @@
3724
import org.springframework.data.domain.Pageable;
3825
import org.springframework.transaction.annotation.Transactional;
3926

27+
import java.util.List;
28+
import java.util.UUID;
29+
30+
import static com.somemore.domains.volunteerapply.domain.ApplyStatus.APPROVED;
31+
import static com.somemore.support.fixture.RecruitBoardFixture.createRecruitBoard;
32+
import static org.assertj.core.api.Assertions.assertThat;
33+
4034
@Transactional
4135
class VolunteerApplyQueryFacadeServiceTest extends IntegrationTestSupport {
4236

src/test/java/com/somemore/user/repository/usercommonattribute/UserCommonAttributeRepositoryImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void findAllByUserIds() {
8585
List<UserCommonAttribute> result = userCommonAttributeRepository.findAllByUserIds(userIds);
8686

8787
// then
88-
assertThat(result.size()).isEqualTo(3);
88+
assertThat(result).hasSize(3);
8989
assertThat(result)
9090
.extracting(UserCommonAttribute::getUserId)
9191
.containsExactlyInAnyOrder(one.getUserId(), two.getUserId(), three.getUserId());

src/test/java/com/somemore/user/service/UserQueryServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void setup() {
4242
UserAuthInfo userAuthInfo = UserAuthInfo.createForOAuth(OAuthProvider.NAVER);
4343

4444
user = userRepository.save(User.of(userAuthInfo, UserRole.VOLUNTEER));
45-
userCommonAttribute = userCommonAttributeRepository.save(UserCommonAttribute.createDefault(user.getId(),UserRole.VOLUNTEER));
45+
userCommonAttribute = userCommonAttributeRepository.save(UserCommonAttribute.createDefault(user.getId(), UserRole.VOLUNTEER));
4646
}
4747

4848

@@ -157,7 +157,7 @@ void findAllByUserIds() {
157157
List<UserCommonAttribute> result = userQueryService.getAllByUserIds(userIds);
158158

159159
// then
160-
assertThat(result.size()).isEqualTo(3);
160+
assertThat(result).hasSize(3);
161161
assertThat(result)
162162
.extracting(UserCommonAttribute::getUserId)
163163
.containsExactlyInAnyOrder(one.getUserId(), two.getUserId(), three.getUserId());

0 commit comments

Comments
 (0)