-
Notifications
You must be signed in to change notification settings - Fork 2
test: 기본 테스트들 추가 #248
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
Merged
test: 기본 테스트들 추가 #248
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
144 changes: 144 additions & 0 deletions
144
src/test/java/com/permitseoul/permitserver/domain/SimpleEnumTest.java
This file contains hidden or 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,144 @@ | ||
| package com.permitseoul.permitserver.domain; | ||
|
|
||
| import com.permitseoul.permitserver.domain.admin.base.core.domain.MediaType; | ||
| import com.permitseoul.permitserver.domain.payment.core.domain.Currency; | ||
| import com.permitseoul.permitserver.domain.payment.core.domain.PaymentType; | ||
| import com.permitseoul.permitserver.domain.ticket.core.domain.TicketStatus; | ||
| import com.permitseoul.permitserver.domain.ticket.core.domain.TicketUsability; | ||
| import com.permitseoul.permitserver.domain.user.core.domain.Gender; | ||
| import com.permitseoul.permitserver.domain.user.core.domain.SocialType; | ||
| import com.permitseoul.permitserver.domain.user.core.domain.UserRole; | ||
| import org.junit.jupiter.api.DisplayName; | ||
| import org.junit.jupiter.api.Nested; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
| import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
|
||
| @DisplayName("단순 Enum 통합 테스트") | ||
| class SimpleEnumTest { | ||
|
|
||
| @Nested | ||
| @DisplayName("Currency") | ||
| class CurrencyTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 3개이다 (KRW, USD, JPY)") | ||
| void hasThreeValues() { | ||
| assertThat(Currency.values()).hasSize(3); | ||
| assertThat(Currency.values()).containsExactly(Currency.KRW, Currency.USD, Currency.JPY); | ||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("valueOf로 KRW를 조회할 수 있다") | ||
| void valueOfKRW() { | ||
| assertThat(Currency.valueOf("KRW")).isEqualTo(Currency.KRW); | ||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("존재하지 않는 값은 IllegalArgumentException을 던진다") | ||
| void throwsExceptionForInvalidValue() { | ||
| assertThatThrownBy(() -> Currency.valueOf("EUR")) | ||
| .isInstanceOf(IllegalArgumentException.class); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("PaymentType") | ||
| class PaymentTypeTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 8개이다") | ||
| void hasEightValues() { | ||
| assertThat(PaymentType.values()).hasSize(8); | ||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("CARD와 EASY_PAY가 포함되어 있다") | ||
| void containsCardAndEasyPay() { | ||
| assertThat(PaymentType.values()) | ||
| .contains(PaymentType.CARD, PaymentType.EASY_PAY); | ||
| } | ||
|
|
||
| @Test | ||
| @DisplayName("valueOf로 CARD를 조회할 수 있다") | ||
| void valueOfCard() { | ||
| assertThat(PaymentType.valueOf("CARD")).isEqualTo(PaymentType.CARD); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("TicketStatus") | ||
| class TicketStatusTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 3개이다 (RESERVED, USED, CANCELED)") | ||
| void hasThreeValues() { | ||
| assertThat(TicketStatus.values()).hasSize(3); | ||
| assertThat(TicketStatus.values()).containsExactly( | ||
| TicketStatus.RESERVED, TicketStatus.USED, TicketStatus.CANCELED); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("TicketUsability") | ||
| class TicketUsabilityTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 2개이다 (USABLE, UNUSABLE)") | ||
| void hasTwoValues() { | ||
| assertThat(TicketUsability.values()).hasSize(2); | ||
| assertThat(TicketUsability.values()).containsExactly( | ||
| TicketUsability.USABLE, TicketUsability.UNUSABLE); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("UserRole") | ||
| class UserRoleTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 3개이다 (USER, ADMIN, STAFF)") | ||
| void hasThreeValues() { | ||
| assertThat(UserRole.values()).hasSize(3); | ||
| assertThat(UserRole.values()).containsExactly( | ||
| UserRole.USER, UserRole.ADMIN, UserRole.STAFF); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("Gender") | ||
| class GenderTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 2개이다 (MALE, FEMALE)") | ||
| void hasTwoValues() { | ||
| assertThat(Gender.values()).hasSize(2); | ||
| assertThat(Gender.values()).containsExactly(Gender.MALE, Gender.FEMALE); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("SocialType") | ||
| class SocialTypeTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 2개이다 (KAKAO, GOOGLE)") | ||
| void hasTwoValues() { | ||
| assertThat(SocialType.values()).hasSize(2); | ||
| assertThat(SocialType.values()).containsExactly(SocialType.KAKAO, SocialType.GOOGLE); | ||
| } | ||
| } | ||
|
|
||
| @Nested | ||
| @DisplayName("MediaType") | ||
| class MediaTypeTest { | ||
|
|
||
| @Test | ||
| @DisplayName("열거값은 2개이다 (IMAGE, VIDEO)") | ||
| void hasTwoValues() { | ||
| assertThat(MediaType.values()).hasSize(2); | ||
| assertThat(MediaType.values()).containsExactly(MediaType.IMAGE, MediaType.VIDEO); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
핵심 캐시 동작 테스트가 모두 비활성화되어 회귀를 잡을 수 없습니다.
현재 리프레시 토큰 캐시 저장/조회 검증이 전부 주석 처리되어 CI에서 이 경로가 전혀 검증되지 않습니다. 주석 대신 실행 가능한 테스트로 복원해 주세요.
🔧 제안 패치 (RTCacheManager 없이 CacheManager 직접 검증)
Also applies to: 31-33, 41-55
🤖 Prompt for AI Agents