Skip to content
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

[TEST] FarmSchedule 테스트코드 작성 #137

Merged
merged 22 commits into from
Nov 12, 2024
Merged

Conversation

stopmin
Copy link
Collaborator

@stopmin stopmin commented Nov 11, 2024

해결하려는 문제가 무엇인가요?

어떻게 해결했나요?

  1. 테스트 코드를 짰어요.
  2. application-test.yml 파일을 추가했어요.

더 하고 싶은 말

  • 테스트 힘들어요.

- 농장 스케쥴 추가
#125
- 농장 스케쥴 추가
#113
- 농장 스케쥴 추가
#113
…ISSUE-113

# Conflicts:
#	src/test/java/poomasi/domain/farm/_schedule/service/FarmScheduleServiceTest.java
- 농장이 존재하지 않는 경우
- 이미 삭제된 경우
#113
- 농장이 삭제된 경우 예외를 발생
#113
- 특정 날짜의 스케쥴 조회
#113
- 중복된 스케줄이 있는 경우 save 메서드가 호출되지 않는다
#113
- 스케줄이 없는 날짜에 대해 빈 리스트를 반환한다
#113
- 특정 월에 해당하는 스케줄을 올바르게 조회한다
- 존재하지 않는 스케줄 ID로 조회 시 예외가 발생한다
#113
@stopmin stopmin added the 🍀 test 테스트 코드 작성 label Nov 11, 2024
@stopmin stopmin requested review from jjt4515 and amm0124 November 11, 2024 12:26
@stopmin stopmin self-assigned this Nov 11, 2024
Copy link

github-actions bot commented Nov 11, 2024

Unit Test Results

29 tests   26 ✔️  1s ⏱️
11 suites    0 💤
11 files      3

For more details on these failures, see this check.

Results for commit dce5d2b.

♻️ This comment has been updated with latest results.

@stopmin stopmin merged commit 96ea648 into week10 Nov 12, 2024
0 of 2 checks passed
stopmin added a commit that referenced this pull request Nov 15, 2024
* feat: S3PresignedUrl
- Presgiend Url 발급 메소드

* refactor: AwsProperties 네이밍 수정

* refactor: 패키지 분리
- aws/s3 분리
#32

* S3 presignedUrl 테스트 코드 작성 #32

* fix: aws 자격 증명 명시 #33

* refactor: PresignedUrlPut 파라미터 수정 #33

* feat: 이미지 정보 저장 로직 구현 #33

* refactor: EncryptionUtil 인코딩 변수 추가 #33

* refactor: presigned-url-put을 PostMapping으로 변경 #33

* feat: 이미지 정보 관리 CRUD 작성 #33

* refactor: 이미지 key 형식 수정 #33

* fix: S3PresignedUrlController 오류 해결 #33

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
#62

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
#62

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
- 생성자 수정
#62

* feat: 시작시간/종료시간 추가
- entity 수정
#62

* feat: 농장 예약/예약취소 로직 수정
- 최대 수용가능 인원/동시간대 최대 수용 팀 수정
#62

* feat: 이미지 삭제 url 수정

* feat: 예약 가능 날짜 추가 API 수정
#62

* chore: 에러문구 수정
#62

* feat: 이미지 delete 문 오타 수정 #33

* fix: 이미지 소프트 삭제 반영 #33

* refactor: 이미지 서비스 리팩토링 #33

* refactor: 소프트 삭제된 이미지 저장 시 복구시키는 로직 추가 #33

* feat: 이미지 복구 로직 추가 #33

* refactor: 이미지 복구 로직 수정 #33

* feat: 멤버 조회 추가 #76

* feat: 자격 증명 Dto 추가 #76

* feat: 고객으로 전환 추가 #76

* feat: 농장 체험 가능 스케쥴 추가 API
#62

* feat: 농장 스케쥴 추가 검증 수정
#62

* feat: 농장 최대 인원 & 예상 금액
#62

* feat: 요청시 일단 수락하도록 설정
#62

* Farm Schedule 관리 방식 및 금액제도 수정 (#73)

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
#62

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
#62

* feature: 팀 최대 인원/동일시간대 최대 예약 가능 팀 수 설정
- 생성자 수정
#62

* feat: 시작시간/종료시간 추가
- entity 수정
#62

* feat: 농장 예약/예약취소 로직 수정
- 최대 수용가능 인원/동시간대 최대 수용 팀 수정
#62

* feat: 예약 가능 날짜 추가 API 수정
#62

* chore: 에러문구 수정
#62

* feat: 농장 체험 가능 스케쥴 추가 API
#62

* feat: 농장 스케쥴 추가 검증 수정
#62

* feat: 농장 최대 인원 & 예상 금액
#62

* feat: 요청시 일단 수락하도록 설정
#62

* 기존 category, product, review 코드 security 적용하기

* feat: product tag 생성 (#72)

* feat: product tag 생성

* refactor: entity빼고 enum으로 관리하게 변경

* style: 정렬

* fix: fetchtype변경, 변수명 변경, 공통로직 추출

* feat: 인증인가 추가 (#74)

* bug: Merge 잘못된 부분 정정

* bug: Merge 잘못된 부분 정정

* FarmSchedule 누락 사항 (#95)

* feat: 스케쥴 존재하는지 확인하도록 수정
#92

* chore: 필요없는 에러 제거
#92

* feat: 스케쥴 ID도 전달하도록 수정
#92

* chore: 시큐리티 수정
#92

* feat: 토큰 재발급 인증 인가 추가 #81

* chore: 회원가입 로직 member 폴더로 위치 변경 #81

* refactor: 멤버 서비스 내 isFarmer, isCustomer 메서드 삭제 #81

* 예약 & 농장 조회 Security 적용 (#98)

* [TEST] Mockito 설정 및 기본 테스트 코드 추가 (#102)

* build: Mockito 의존성 추가
- 5.12.0 Version
#101

* test: 농장 조회 테스트 추가
- 테스트 용입니당..!
#101

* chore: 의존성 정리
#101

* feat: 이미지 타입에 멤버 프로필 추가 및 멤버 조회 로직 관리자, 멤버 권한 별로 분리 #81

* feat: 멤버 Security 적용 #81

* [CICD] ECS CICD 파이프라인 구축 (#105)

* feat: Dockerfile정의
#103

* feat: HealthcheckController 정의
- 200 ok
#103

* build: jar plain 생성 x
#103

* feat: prod 환경 추가
- application-prod.yml 추가
#103

* feat: deploy-ecs.yml 정의
#103

* feat: deploy-ecs.yml 수정
- build-arg 수정
#103

* feat: 이미지 타입에 멤버 프로필 추가 및 이미지 Security 적용 #81

* feat: S3 Security 적용 #81

* build : 빌드 수정

* feat : exception 및 포트원 실패 reason handler 추가

* refactoring : 기존 order/refund refactoring
- 삭제

* refactoring : order/payment/aftersales(환불,교환,취소) entity 수정

* refactoring : order/payment/aftersales(환불,교환,취소) entity enum type

* feat : farm/product 연관관계/메서드 추가

* feat : 멤버 필드 이름 변경

* feat : exception handler 추가

* feat : order/payment dto 추가

* feat : order controller/service/repository 변경

* feat : security config 수정

* feat : payment controller/service 수정

* feat : after sales(결제 전 취소, 환불, 교환) controller/ service/entity 추가

* feat : farm order details(미정)

* feat: Reservation에 price 추가 (#108)

#99

* [CICD] tf-prod.json 파일 추가 (#115)

* feat: tf-prod.json 추가
#114

* feat: deploy-ecs.yml
- java version 다운그레이드
- prod환경으로 수정
#114

* [CI] 테스트 실패 시 GitHub 봇 댓글 알림 기능 추가 (#117)

* feat: ci-test.yml
#116

* feat: ci-test.yml
- permission 추가
#116

* feat: ci-test.yml
- gradlew 권한 추가
#116

* feat: ci-test.yml
- secondary rate limit 대기시간 추가
#116

* feat: ci-test.yml
- 권한 수정
#116

* feat: ci-test.yml
- 권한 수정
#116

* feat: ci-test.yml
- 권한 수정
#116

* feat: ci-test.yml
- 권한 수정
#116

* feat: ci-test.yml
- gradlew 실행 권한 부여
#116

* feat : 기존 controller 삭제
- 하나로 통합 예정

* [TEST] Farm 테스트 코드 작성 (#112)

* test: 농장이 존재하지 않는 경우
#93

* chore: Member Builder 수정
- ID 추가 (테스트 용)
#93

* test: FarmFarmerServiceTest
- 농장 등록 테스트
- 농장 정보 업데이트 테스트
- 농장 삭제 테스트
#93

* test: FarmPlatformServiceTest
- ID로 농장 가져오기
- 농장 리스트 가져오기
#93

* refactor: 토큰 재발급 액세스 토큰 추출 로직 수정 #124

* refactor: 회원 본인 조회 권한에 관리자도 추가 #124

* refactor: 멤버 권한 농부로 전환 로직 권한을 CUSTOMER로 수정 #124

* refactor: 이미지 제한 갯수 상수 처리 #124

* refactor: 이미지 서비스에서 멤버 프로필 서비스를 의존 #124

* fix: Bean 못 찾는 문제 해결 #124

* refactor: reissueToken 서비스 로직 인자 수정 #124

* fix: 오류 일단 해결 #124

* feat: 고객, 농부 프로필 엔티티 생성 #82

* refactor: 회원가입 시 name도 받도록 #82

* feat: Role별 Profile 분리 #82

* fix: findByEmailAndDeletedAtIsNull로 수정 #82

* refactor: 회원 전체 조회 -> 전체 요약 조회로 변경 #82

* refactor: MemberProfileResponse 인터페이스로 변경 #82

* store생성하기  (#104)

* feat: store 생성

* refactor: store를 product에서 빼기

* chore: confilct 나면서 이상한 잡버그 수정

* ReviewResponse에서 getName부분 수정 #129

* fix: 충돌 해결 #129

* fix: 순환 참조 문제 해결 #129

* feat : product cancel(배송 전 취소) 구현
- 배송 전인 경우에만 취소를 할 수 있도록 구현.
- 그 이후 상태는 배송중으로 판단하여 취소 할 수 없도록 구현

* refactoring : 추상 클래스 삭제 및 enum type 변경

* feat : order/payment/after sales 변경
- 다중 결제취소 등등을 위해 entity 구조를 변경했습니다
- AbstractOrder를 상속받는 productOrder, farmOrder
- 각 Order Entity는 list의 orderedProduct, orderedFarm을 가짐
- 각 Order는 Payment 방식을 기록한 Payment entity를 가짐
- 각 Order는 order의 detail을 가지는 orderdetail을 가짐

- orderedProduct는 aftersales를 list로 가짐
- aftersales는 refunddetail을 1:1 관계로 가짐

* feat : error 추가 및 ExceptionAdvice추가
- IamportResponseException을 전역적으로 잡기 위해 advice를 추가하였습니다
- IOException을 전역적으로 잡기 위해 advice를 추가하였습니다

* refactoring : controller 변경

* feat : iamport config와 paymentUtil 분리
- 기존 paymentService가 너무 많은 결제 로직을 담당하였습니다
근데 다론 service에서도 이를 호출하니 너무 복잡한 의존관계가 된 것 같아서 paymentUtil을 구현하였습니다.

* refactoring : payment service 나눔
- 두 개의 도메인에 대해서 service를 나누었습니다
두 service는 나중에 인터페이스를 상속받아서 구현하겠습니다

* feat : cancelService interface 구현
- 두 도메인에서 공통적으로 사용하는 cancel을 제네릭을 사용하여 인터페이스를 작성하였습니다

* feat : after service를 위한 dto
- record 객체로 구현하였습니다

* feat : after sales service를 구현

* feat : 상품 등록 dto 및 after sales repository 구현

* feat : farm order service 및 인터페이스 구현
- 상세 내용은 내일 작성하겠습니다

* refactoring : product order repository와 service 구현

* conflict 해결

* conflict 해결

* [TEST] FarmSchedule 테스트코드 작성 (#137)

* test: FarmScheduleServiceTest
- 농장 스케쥴 추가
#125

* test: FarmScheduleServiceTest
- 농장 스케쥴 추가
#113

* test: FarmScheduleServiceTest
- 농장 스케쥴 추가
#113

* test: FarmScheduleServiceTest
- 농장이 존재하지 않는 경우
- 이미 삭제된 경우
#113

* test: FarmScheduleServiceTest
- 농장이 삭제된 경우 예외를 발생
#113

* test: FarmScheduleServiceTest
- 특정 날짜의 스케쥴 조회
#113

* test: FarmScheduleServiceTest
- 중복된 스케줄이 있는 경우 save 메서드가 호출되지 않는다
#113

* test: FarmScheduleServiceTest
- 스케줄이 없는 날짜에 대해 빈 리스트를 반환한다
#113

* test: FarmScheduleServiceTest
- 특정 월에 해당하는 스케줄을 올바르게 조회한다
- 존재하지 않는 스케줄 ID로 조회 시 예외가 발생한다
#113

* test: 테스트 환경 키값 추가
- application-test.yml
#113

* build: ci-test.yml 수정
- imp 키값 추가
#113

* build: ci-test.yml 수정
- imp 키값 추가
#113

* chore: 오타 수정
#113

* test: imp-key 값 추가
#113

* test: 테스트 실패 시 로그 남기도록
#113

* test: 테스트 실패 시 로그 남기도록
- 버전 업그레이드
#113

* build: 테스트 디비 추가
#113

* build: AWS 키값 추가
#113

* test: Iamport 모킹 설정
#113

* test: spring profile 설정
#113

---------

Co-authored-by: stopmin <[email protected]>
Co-authored-by: 정진택 <[email protected]>
Co-authored-by: 정지민 <[email protected]>
Co-authored-by: canyos <[email protected]>
Co-authored-by: amm0124 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍀 test 테스트 코드 작성
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant