-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test : Activity 생성 테스트를 위한 FakeRepository 및 테스트 코드 추가
- 활동 Repository 를 분리하여 FakeActivityRepository를 작성 - FakeActivityRepository를 활용한 Activity 생성 로직의 단위 테스트 코드 작성
- Loading branch information
Showing
41 changed files
with
882 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/umc/kkijuk/server/career/repository/ActivityJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Activity; | ||
|
||
import java.util.List; | ||
|
||
public interface ActivityJpaRepository extends JpaRepository<Activity, Long> { | ||
List<Activity> findByMemberId(Long memberId); | ||
List<Activity> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
} |
9 changes: 7 additions & 2 deletions
9
src/main/java/umc/kkijuk/server/career/repository/ActivityRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Activity; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface ActivityRepository extends JpaRepository<Activity, Long> { | ||
public interface ActivityRepository { | ||
List<Activity> findByMemberId(Long memberId); | ||
List<Activity> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
Activity save(Activity activity); | ||
|
||
Optional<Activity> findById(Long activityId); | ||
|
||
void delete(Activity activity); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/umc/kkijuk/server/career/repository/ActivityRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.kkijuk.server.career.domain.Activity; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class ActivityRepositoryImpl implements ActivityRepository{ | ||
private final ActivityJpaRepository activityJpaRepository; | ||
@Override | ||
public List<Activity> findByMemberId(Long memberId) { | ||
return activityJpaRepository.findByMemberId(memberId); | ||
} | ||
@Override | ||
public List<Activity> findByMemberIdAndNameContaining(Long memberId, String keyword) { | ||
return activityJpaRepository.findByMemberIdAndNameContaining(memberId,keyword); | ||
} | ||
@Override | ||
public Activity save(Activity activity) { | ||
return activityJpaRepository.save(activity); | ||
} | ||
@Override | ||
public Optional<Activity> findById(Long activityId) { | ||
return activityJpaRepository.findById(activityId); | ||
} | ||
|
||
@Override | ||
public void delete(Activity activity) { | ||
activityJpaRepository.delete(activity); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/umc/kkijuk/server/career/repository/CareerEtcJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.CareerEtc; | ||
|
||
import java.util.List; | ||
|
||
public interface CareerEtcJpaRepository extends JpaRepository<CareerEtc,Long> { | ||
List<CareerEtc> findByMemberId(Long memberId); | ||
|
||
List<CareerEtc> findByMemberIdAndNameContaining(Long id, String keyword); | ||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/umc/kkijuk/server/career/repository/CareerEtcRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.CareerEtc; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface CareerEtcRepository extends JpaRepository<CareerEtc,Long> { | ||
public interface CareerEtcRepository { | ||
List<CareerEtc> findByMemberId(Long memberId); | ||
|
||
List<CareerEtc> findByMemberIdAndNameContaining(Long id, String keyword); | ||
|
||
CareerEtc save(CareerEtc etc); | ||
|
||
Optional<CareerEtc> findById(Long etcId); | ||
|
||
void delete(CareerEtc etc); | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/umc/kkijuk/server/career/repository/CareerEtcRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.kkijuk.server.career.domain.CareerEtc; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class CareerEtcRepositoryImpl implements CareerEtcRepository{ | ||
private final CareerEtcJpaRepository careerEtcJpaRepository; | ||
@Override | ||
public List<CareerEtc> findByMemberId(Long memberId) { | ||
return careerEtcJpaRepository.findByMemberId(memberId); | ||
} | ||
|
||
@Override | ||
public List<CareerEtc> findByMemberIdAndNameContaining(Long id, String keyword) { | ||
return careerEtcJpaRepository.findByMemberIdAndNameContaining(id, keyword); | ||
} | ||
@Override | ||
public CareerEtc save(CareerEtc etc) { | ||
return careerEtcJpaRepository.save(etc); | ||
} | ||
@Override | ||
public Optional<CareerEtc> findById(Long etcId) { | ||
return careerEtcJpaRepository.findById(etcId); | ||
} | ||
@Override | ||
public void delete(CareerEtc etc) { | ||
careerEtcJpaRepository.delete(etc); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/umc/kkijuk/server/career/repository/CircleJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Circle; | ||
|
||
import java.util.List; | ||
|
||
public interface CircleJpaRepository extends JpaRepository<Circle, Long> { | ||
List<Circle> findByMemberId(Long memberId); | ||
List<Circle> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/umc/kkijuk/server/career/repository/CircleRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Circle; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface CircleRepository extends JpaRepository<Circle, Long> { | ||
public interface CircleRepository { | ||
List<Circle> findByMemberId(Long memberId); | ||
List<Circle> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
|
||
Circle save(Circle circle); | ||
|
||
Optional<Circle> findById(Long circleId); | ||
|
||
void delete(Circle circle); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/umc/kkijuk/server/career/repository/CircleRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.kkijuk.server.career.domain.Circle; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class CircleRepositoryImpl implements CircleRepository{ | ||
private final CircleJpaRepository circleJpaRepository; | ||
@Override | ||
public List<Circle> findByMemberId(Long memberId) { | ||
return circleJpaRepository.findByMemberId(memberId); | ||
} | ||
|
||
@Override | ||
public List<Circle> findByMemberIdAndNameContaining(Long memberId, String keyword) { | ||
return circleJpaRepository.findByMemberIdAndNameContaining(memberId,keyword); | ||
} | ||
|
||
@Override | ||
public Circle save(Circle circle) { | ||
return circleJpaRepository.save(circle); | ||
} | ||
|
||
@Override | ||
public Optional<Circle> findById(Long circleId) { | ||
return circleJpaRepository.findById(circleId); | ||
} | ||
|
||
@Override | ||
public void delete(Circle circle) { | ||
circleJpaRepository.delete(circle); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/umc/kkijuk/server/career/repository/CompetitionJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Competition; | ||
|
||
import java.util.List; | ||
|
||
public interface CompetitionJpaRepository extends JpaRepository<Competition, Long> { | ||
List<Competition> findByMemberId(Long memberId); | ||
List<Competition> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/umc/kkijuk/server/career/repository/CompetitionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Competition; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface CompetitionRepository extends JpaRepository<Competition, Long> { | ||
public interface CompetitionRepository { | ||
List<Competition> findByMemberId(Long memberId); | ||
List<Competition> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
|
||
Competition save(Competition competition); | ||
|
||
Optional<Competition> findById(Long competitionId); | ||
|
||
void delete(Competition comp); | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/umc/kkijuk/server/career/repository/CompetitionRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.kkijuk.server.career.domain.Competition; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class CompetitionRepositoryImpl implements CompetitionRepository{ | ||
private final CompetitionJpaRepository competitionJpaRepository; | ||
@Override | ||
public List<Competition> findByMemberId(Long memberId) { | ||
return competitionJpaRepository.findByMemberId(memberId); | ||
} | ||
@Override | ||
public List<Competition> findByMemberIdAndNameContaining(Long memberId, String keyword) { | ||
return competitionJpaRepository.findByMemberIdAndNameContaining(memberId,keyword); | ||
} | ||
|
||
@Override | ||
public Competition save(Competition competition) { | ||
return competitionJpaRepository.save(competition); | ||
} | ||
|
||
@Override | ||
public Optional<Competition> findById(Long competitionId) { | ||
return competitionJpaRepository.findById(competitionId); | ||
} | ||
|
||
@Override | ||
public void delete(Competition comp) { | ||
competitionJpaRepository.delete(comp); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/umc/kkijuk/server/career/repository/EduCareerJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.EduCareer; | ||
|
||
import java.util.List; | ||
|
||
public interface EduCareerJpaRepository extends JpaRepository<EduCareer,Long> { | ||
List<EduCareer> findByMemberId(Long memberId); | ||
List<EduCareer> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
} |
10 changes: 8 additions & 2 deletions
10
src/main/java/umc/kkijuk/server/career/repository/EduCareerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.EduCareer; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface EduCareerRepository extends JpaRepository<EduCareer,Long> { | ||
public interface EduCareerRepository { | ||
List<EduCareer> findByMemberId(Long memberId); | ||
List<EduCareer> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
|
||
EduCareer save(EduCareer edu); | ||
|
||
Optional<EduCareer> findById(Long educareerId); | ||
|
||
void delete(EduCareer eduCareer); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/umc/kkijuk/server/career/repository/EduCareerRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.kkijuk.server.career.domain.EduCareer; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class EduCareerRepositoryImpl implements EduCareerRepository{ | ||
private final EduCareerJpaRepository eduCareerJpaRepository; | ||
@Override | ||
public List<EduCareer> findByMemberId(Long memberId) { | ||
return eduCareerJpaRepository.findByMemberId(memberId); | ||
} | ||
|
||
@Override | ||
public List<EduCareer> findByMemberIdAndNameContaining(Long memberId, String keyword) { | ||
return eduCareerJpaRepository.findByMemberIdAndNameContaining(memberId,keyword); | ||
} | ||
|
||
@Override | ||
public EduCareer save(EduCareer edu) { | ||
return eduCareerJpaRepository.save(edu); | ||
} | ||
|
||
@Override | ||
public Optional<EduCareer> findById(Long educareerId) { | ||
return eduCareerJpaRepository.findById(educareerId); | ||
} | ||
|
||
@Override | ||
public void delete(EduCareer eduCareer) { | ||
eduCareerJpaRepository.delete(eduCareer); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/umc/kkijuk/server/career/repository/EmploymentJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package umc.kkijuk.server.career.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.kkijuk.server.career.domain.Employment; | ||
|
||
import java.util.List; | ||
|
||
public interface EmploymentJpaRepository extends JpaRepository<Employment,Long> { | ||
List<Employment> findByMemberId(Long memberId); | ||
List<Employment> findByMemberIdAndNameContaining(Long memberId, String keyword); | ||
} |
Oops, something went wrong.