Skip to content

Commit 1ff3ce9

Browse files
committed
refactor(sonar 반영): unused import, chaining join, 명시적인 엔티티 default fields
1 parent f2e7947 commit 1ff3ce9

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class VolunteerDetailRepositoryImpl implements VolunteerDetailRepository
1717
private final VolunteerDetailJpaRepository volunteerDetailJpaRepository;
1818
private final JPAQueryFactory queryFactory;
1919

20-
private final QVolunteerDetail volunteerDetail = QVolunteerDetail.volunteerDetail;
20+
private static final QVolunteerDetail volunteerDetail = QVolunteerDetail.volunteerDetail;
2121

2222
@Override
2323
public VolunteerDetail save(VolunteerDetail volunteerDetail) {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
import com.somemore.volunteer.domain.Volunteer;
44
import org.springframework.data.jpa.repository.JpaRepository;
55

6-
import java.util.Optional;
7-
import java.util.UUID;
8-
96
public interface VolunteerJpaRepository extends JpaRepository<Volunteer, Long> {
107
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import java.util.Optional;
1212
import java.util.UUID;
13-
import java.util.function.Function;
1413

1514
@RequiredArgsConstructor
1615
@Repository
@@ -19,7 +18,7 @@ public class VolunteerRepositoryImpl implements VolunteerRepository {
1918
private final VolunteerJpaRepository volunteerJpaRepository;
2019
private final JPAQueryFactory queryFactory;
2120

22-
private final QVolunteer volunteer = QVolunteer.volunteer;
21+
private static final QVolunteer volunteer = QVolunteer.volunteer;
2322

2423
@Override
2524
public Volunteer save(Volunteer volunteer) {

src/main/java/com/somemore/volunteer/service/RegisterVolunteerService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.somemore.volunteer.domain.Volunteer;
44
import com.somemore.volunteer.domain.VolunteerDetail;
55
import com.somemore.volunteer.dto.request.VolunteerRegisterRequestDto;
6-
import com.somemore.volunteer.repository.VolunteerDetailJpaRepository;
76
import com.somemore.volunteer.repository.VolunteerDetailRepository;
87
import com.somemore.volunteer.repository.VolunteerRepository;
98
import com.somemore.volunteer.usecase.RegisterVolunteerUseCase;

src/main/java/com/somemore/volunteerApply/domain/VolunteerApply.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ public class VolunteerApply extends BaseEntity {
2727

2828
@Enumerated(EnumType.STRING)
2929
@Column(name = "status", nullable = false, length = 20)
30-
private ApplyStatus status;
30+
private ApplyStatus status = ApplyStatus.WAITING;
3131

3232
@Column(name = "attended", nullable = false)
33-
private Boolean attended;
33+
private Boolean attended = false;
3434

3535
@Builder
3636
public VolunteerApply(UUID volunteerId, Long recruitBoardId, ApplyStatus status, Boolean attended) {
3737
this.volunteerId = volunteerId;
3838
this.recruitBoardId = recruitBoardId;
39-
this.status = status != null ? status : ApplyStatus.WAITING;
40-
this.attended = attended != null ? attended : false;
39+
this.status = status;
40+
this.attended = attended;
4141
}
4242
}
4343

src/main/java/com/somemore/volunteerApply/repository/VolunteerApplyRepositoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class VolunteerApplyRepositoryImpl implements VolunteerApplyRepository {
2323
private final VolunteerApplyJpaRepository volunteerApplyJpaRepository;
2424
private final JPAQueryFactory queryFactory;
2525

26-
private final QVolunteerApply volunteerApply = QVolunteerApply.volunteerApply;
26+
private static final QVolunteerApply volunteerApply = QVolunteerApply.volunteerApply;
2727

2828
@Override
2929
public VolunteerApply save(VolunteerApply volunteerApply) {

src/test/java/com/somemore/recruitboard/repository/RecruitBoardRepositoryImplTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@ void findNotCompletedIdsByCenterIds() {
247247

248248
// then
249249
assertThat(notCompletedBoardIds)
250-
.hasSize(2);
251-
252-
assertThat(notCompletedBoardIds)
250+
.hasSize(2)
253251
.doesNotContain(deletedRecruitingBoard.getId())
254252
.doesNotContain(deletedClosedBoard.getId())
255253
.doesNotContain(deletedCompletedRecruitBoard.getId())

0 commit comments

Comments
 (0)