From 7a82e21e1a86389798fdf498dc1da21ac3e83c36 Mon Sep 17 00:00:00 2001 From: Jo Kyung Hyeon Date: Mon, 28 Nov 2022 08:57:07 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test:=20(#158)=20Domain=20Properties=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=A0=84=EC=B2=B4=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comit/simtong/domain/DomainPropertiesInitialization.kt | 6 +----- .../domain/auth/usecase/ReissueTokenUseCaseTests.kt | 7 +++++-- .../domain/auth/usecase/SendAuthCodeUseCaseTests.kt | 3 +++ .../simtong/domain/file/usecase/UploadImageUseCaseTests.kt | 3 +++ .../domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt | 3 +++ .../domain/menu/usecase/QueryPublicMenuUseCaseTests.kt | 3 +++ .../schedule/usecase/AddIndividualScheduleUseCaseTests.kt | 3 +++ .../domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt | 3 +++ .../usecase/ChangeIndividualScheduleUseCaseTest.kt | 3 +++ .../schedule/usecase/ChangeSpotScheduleUseCaseTests.kt | 3 +++ .../schedule/usecase/EntireSpotScheduleUseCaseTests.kt | 3 +++ .../schedule/usecase/RemoveSpotScheduleUseCaseTests.kt | 3 +++ .../domain/spot/usecase/ShowSpotListUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/AdminSignInUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt | 3 +++ .../domain/user/usecase/ChangeNicknameUseCaseTests.kt | 3 +++ .../domain/user/usecase/ChangePasswordUseCaseTests.kt | 3 +++ .../domain/user/usecase/ChangeProfileImageUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt | 3 +++ .../user/usecase/CheckEmailDuplicationUseCaseTests.kt | 3 +++ .../domain/user/usecase/CheckMatchedAccountUseCaseTests.kt | 3 +++ .../user/usecase/CheckNicknameDuplicationUseCaseTests.kt | 4 +++- .../domain/user/usecase/FindEmployeeNumberUseCaseTests.kt | 5 ++++- .../domain/user/usecase/ResetPasswordUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/SignInUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/SignUpUseCaseTests.kt | 3 +++ .../simtong/domain/user/usecase/UserInfoUseCaseTests.kt | 3 +++ 27 files changed, 82 insertions(+), 9 deletions(-) diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt index ff76e8cb..c08ca758 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt @@ -3,11 +3,7 @@ package team.comit.simtong.domain import team.comit.simtong.global.DomainProperties import team.comit.simtong.global.DomainPropertiesPrefix -/** - * 가장 처음 테스트되는 클래스에 Import - * Domain Properties 초기화 - */ -class DomainPropertiesInitialization { +object DomainPropertiesInitialization { init { DomainProperties.putAll( mapOf( diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt index ba40b642..be403fa3 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt @@ -7,15 +7,18 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization +import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.auth.exception.RefreshTokenNotFoundException import team.comit.simtong.domain.auth.model.RefreshToken -import team.comit.simtong.domain.auth.spi.QueryRefreshTokenPort import team.comit.simtong.domain.auth.spi.JwtPort -import team.comit.simtong.domain.auth.dto.TokenResponse +import team.comit.simtong.domain.auth.spi.QueryRefreshTokenPort import team.comit.simtong.domain.user.model.Authority import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ReissueTokenUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt index 1635e018..3ea5cdc1 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt @@ -9,7 +9,9 @@ import org.mockito.BDDMockito.given import org.mockito.BDDMockito.willDoNothing import org.mockito.kotlin.any import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.CertifiedEmailException import team.comit.simtong.domain.auth.exception.ExceededSendAuthCodeRequestException import team.comit.simtong.domain.auth.model.AuthCode @@ -19,6 +21,7 @@ import team.comit.simtong.domain.auth.spi.CommandAuthCodePort import team.comit.simtong.domain.auth.spi.QueryAuthCodeLimitPort import team.comit.simtong.domain.auth.spi.SendEmailPort +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class SendAuthCodeUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt index 7c380ff4..0d9101cd 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt @@ -7,11 +7,14 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.file.exception.FileInvalidExtensionException import team.comit.simtong.domain.file.spi.UploadFilePort import java.io.File +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class UploadImageUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt index c7418f42..060924db 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.menu.model.Menu import team.comit.simtong.domain.menu.spi.MenuQueryUserPort import team.comit.simtong.domain.menu.spi.MenuSecurityPort @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.model.User import java.time.LocalDate import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class QueryMenuByMonthUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt index ae986174..4e4a0566 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt @@ -6,12 +6,15 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.menu.model.Menu import team.comit.simtong.domain.menu.spi.QueryMenuPort import java.time.LocalDate import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class QueryPublicMenuUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt index e214bfd4..1cb26ff4 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.AddIndividualScheduleRequest import team.comit.simtong.domain.schedule.spi.CommandSchedulePort import team.comit.simtong.domain.schedule.spi.ScheduleQueryUserPort @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.model.User import java.time.LocalDate import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class AddIndividualScheduleUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt index 375fafe3..43764aac 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.AddSpotScheduleRequest import team.comit.simtong.domain.schedule.spi.CommandSchedulePort import team.comit.simtong.domain.schedule.spi.ScheduleQueryUserPort @@ -19,6 +21,7 @@ import team.comit.simtong.domain.user.model.User import java.time.LocalDate import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class AddSpotScheduleUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt index b1d1eb24..4af2ef33 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt @@ -8,7 +8,9 @@ import org.junit.jupiter.api.extension.ExtendWith import org.mockito.Mock import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.ChangeIndividualScheduleRequest import team.comit.simtong.domain.schedule.exception.NotScheduleOwnerException import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException @@ -25,6 +27,7 @@ import java.time.LocalDate import java.time.LocalTime import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeIndividualScheduleUseCaseTest { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt index 2278843f..f64af9d4 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.ChangeSpotScheduleRequest import team.comit.simtong.domain.schedule.exception.NotScheduleOwnerException import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException @@ -24,6 +26,7 @@ import team.comit.simtong.domain.user.model.User import java.time.LocalDate import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeSpotScheduleUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt index bf82af80..c0437ccb 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt @@ -6,7 +6,9 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.EntireSpotScheduleResponse import team.comit.simtong.domain.schedule.dto.SpotScheduleResponse import team.comit.simtong.domain.schedule.model.Scope @@ -15,6 +17,7 @@ import team.comit.simtong.domain.schedule.vo.SpotSchedule import java.time.LocalDate import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class EntireSpotScheduleUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt index b4098de8..ad806413 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException import team.comit.simtong.domain.schedule.model.Schedule import team.comit.simtong.domain.schedule.model.Scope @@ -22,6 +24,7 @@ import team.comit.simtong.domain.user.model.User import java.time.LocalDate import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class RemoveSpotScheduleUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt index 331452ae..2be102a1 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt @@ -6,12 +6,15 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.spot.dto.SpotResponse import team.comit.simtong.domain.spot.model.Spot import team.comit.simtong.domain.spot.spi.QuerySpotPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ShowSpotListUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt index 3c5a5932..fdabf92f 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.user.dto.SignInRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException @@ -20,6 +22,7 @@ import team.comit.simtong.domain.user.spi.UserJwtPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class AdminSignInUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt index 422f9728..4b3794ea 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException import team.comit.simtong.domain.auth.exception.UsedEmailException @@ -22,6 +24,7 @@ import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeEmailUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt index 9af65677..b54e50ac 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedNicknameException import team.comit.simtong.domain.user.dto.ChangeNicknameRequest import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeNicknameUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt index 2172fc26..03928694 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.user.dto.ChangePasswordRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangePasswordUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt index 1b08d89f..c326002c 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.file.exception.NotFoundFilePathException import team.comit.simtong.domain.file.spi.CheckFilePort import team.comit.simtong.domain.user.dto.ChangeProfileImageRequest @@ -19,6 +21,7 @@ import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeProfileImageUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt index c2a22fa4..208a0dc7 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.spot.exception.SpotNotFoundException import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.spi.UserQuerySpotPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ChangeSpotUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt index 6b604561..a322d891 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt @@ -7,10 +7,13 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedEmailException import team.comit.simtong.domain.user.spi.QueryUserPort +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class CheckEmailDuplicationUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt index 67bf12cd..f3ad0496 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt @@ -7,11 +7,14 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.user.dto.CheckMatchedAccountRequest import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.spi.QueryUserPort +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class CheckMatchedAccountUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt index 298172d7..79fa0532 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt @@ -7,11 +7,13 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.auth.exception.UsedEmailException +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedNicknameException import team.comit.simtong.domain.user.spi.QueryUserPort +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class CheckNicknameDuplicationUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt index 7b1e57ee..e311773d 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt @@ -7,14 +7,17 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization +import team.comit.simtong.domain.user.dto.FindEmployeeNumberRequest import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.QueryUserPort -import team.comit.simtong.domain.user.dto.FindEmployeeNumberRequest import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class FindEmployeeNumberUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt index 4d4b8939..ea009aa2 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException import team.comit.simtong.domain.auth.model.AuthCodeLimit @@ -21,6 +23,7 @@ import team.comit.simtong.domain.user.spi.UserQueryAuthCodeLimitPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class ResetPasswordUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt index 037dd941..24a47b1d 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.user.dto.SignInRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException @@ -20,6 +22,7 @@ import team.comit.simtong.domain.user.spi.UserJwtPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class SignInUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt index 1655493b..252e1943 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException @@ -29,6 +31,7 @@ import team.comit.simtong.domain.user.spi.UserQueryTeamPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.* +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class SignUpUseCaseTests { diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt index ac27a598..2a28e6de 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt @@ -7,7 +7,9 @@ import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.spot.exception.SpotNotFoundException import team.comit.simtong.domain.spot.model.Spot import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,6 +20,7 @@ import team.comit.simtong.domain.user.spi.UserQuerySpotPort import team.comit.simtong.domain.user.spi.UserSecurityPort import java.util.UUID +@Import(DomainPropertiesInitialization::class) @ExtendWith(SpringExtension::class) class UserInfoUseCaseTests { From a7d0003df0c2c66cf48268b12bdeb02739f1e4d4 Mon Sep 17 00:00:00 2001 From: Jo Kyung Hyeon Date: Mon, 28 Nov 2022 09:13:34 +0900 Subject: [PATCH 2/2] add: (#158) SimtongTest Annotation --- .../auth/usecase/CheckAuthCodeUseCaseTests.kt | 8 ++------ .../domain/auth/usecase/ReissueTokenUseCaseTests.kt | 11 ++++------- .../domain/auth/usecase/SendAuthCodeUseCaseTests.kt | 8 ++------ .../domain/file/usecase/UploadImageUseCaseTests.kt | 8 ++------ .../menu/usecase/QueryMenuByMonthUseCaseTests.kt | 10 +++------- .../menu/usecase/QueryPublicMenuUseCaseTests.kt | 10 +++------- .../usecase/AddIndividualScheduleUseCaseTests.kt | 8 ++------ .../schedule/usecase/AddSpotScheduleUseCaseTests.kt | 8 ++------ .../usecase/ChangeIndividualScheduleUseCaseTest.kt | 8 ++------ .../usecase/ChangeSpotScheduleUseCaseTests.kt | 8 ++------ .../usecase/EntireSpotScheduleUseCaseTests.kt | 8 ++------ .../usecase/RemoveSpotScheduleUseCaseTests.kt | 8 ++------ .../domain/spot/usecase/ShowSpotListUseCaseTests.kt | 8 ++------ .../domain/user/usecase/AdminSignInUseCaseTests.kt | 11 ++++------- .../domain/user/usecase/ChangeEmailUseCaseTests.kt | 8 ++------ .../user/usecase/ChangeNicknameUseCaseTests.kt | 8 ++------ .../user/usecase/ChangePasswordUseCaseTests.kt | 8 ++------ .../user/usecase/ChangeProfileImageUseCaseTests.kt | 8 ++------ .../domain/user/usecase/ChangeSpotUseCaseTests.kt | 2 +- .../usecase/CheckEmailDuplicationUseCaseTests.kt | 8 ++------ .../user/usecase/CheckMatchedAccountUseCaseTests.kt | 8 ++------ .../usecase/CheckNicknameDuplicationUseCaseTests.kt | 8 ++------ .../user/usecase/FindEmployeeNumberUseCaseTests.kt | 10 +++------- .../user/usecase/ResetPasswordUseCaseTests.kt | 8 ++------ .../domain/user/usecase/SignInUseCaseTests.kt | 8 ++------ .../domain/user/usecase/SignUpUseCaseTests.kt | 8 ++------ .../domain/user/usecase/UserInfoUseCaseTests.kt | 8 ++------ .../DomainPropertiesInitialization.kt | 2 +- .../comit/simtong/global/annotation/SimtongTest.kt | 13 +++++++++++++ 29 files changed, 74 insertions(+), 163 deletions(-) rename simtong-application/src/test/kotlin/team/comit/simtong/{domain => global}/DomainPropertiesInitialization.kt (94%) create mode 100644 simtong-application/src/test/kotlin/team/comit/simtong/global/annotation/SimtongTest.kt diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt index a78be318..71933108 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt @@ -4,19 +4,15 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.AuthCodeMismatchException import team.comit.simtong.domain.auth.model.AuthCode import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort import team.comit.simtong.domain.auth.spi.QueryAuthCodePort +import team.comit.simtong.global.annotation.SimtongTest -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class CheckAuthCodeUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt index be403fa3..26d3235a 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/ReissueTokenUseCaseTests.kt @@ -4,22 +4,19 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.auth.exception.RefreshTokenNotFoundException import team.comit.simtong.domain.auth.model.RefreshToken import team.comit.simtong.domain.auth.spi.JwtPort import team.comit.simtong.domain.auth.spi.QueryRefreshTokenPort import team.comit.simtong.domain.user.model.Authority -import java.util.* +import team.comit.simtong.global.annotation.SimtongTest +import java.util.Date +import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ReissueTokenUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt index 3ea5cdc1..1e371479 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt @@ -4,14 +4,10 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.mockito.BDDMockito.willDoNothing import org.mockito.kotlin.any import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.CertifiedEmailException import team.comit.simtong.domain.auth.exception.ExceededSendAuthCodeRequestException import team.comit.simtong.domain.auth.model.AuthCode @@ -20,9 +16,9 @@ import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort import team.comit.simtong.domain.auth.spi.CommandAuthCodePort import team.comit.simtong.domain.auth.spi.QueryAuthCodeLimitPort import team.comit.simtong.domain.auth.spi.SendEmailPort +import team.comit.simtong.global.annotation.SimtongTest -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class SendAuthCodeUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt index 0d9101cd..f88784cd 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt @@ -4,18 +4,14 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.file.exception.FileInvalidExtensionException import team.comit.simtong.domain.file.spi.UploadFilePort +import team.comit.simtong.global.annotation.SimtongTest import java.io.File -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class UploadImageUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt index 060924db..b0f1dcee 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryMenuByMonthUseCaseTests.kt @@ -4,12 +4,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.menu.model.Menu import team.comit.simtong.domain.menu.spi.MenuQueryUserPort import team.comit.simtong.domain.menu.spi.MenuSecurityPort @@ -17,11 +13,11 @@ import team.comit.simtong.domain.menu.spi.QueryMenuPort import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate -import java.util.* +import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class QueryMenuByMonthUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt index 4e4a0566..5475bf7e 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/menu/usecase/QueryPublicMenuUseCaseTests.kt @@ -3,19 +3,15 @@ package team.comit.simtong.domain.menu.usecase import org.assertj.core.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.menu.model.Menu import team.comit.simtong.domain.menu.spi.QueryMenuPort +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate -import java.util.* +import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class QueryPublicMenuUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt index 1cb26ff4..6be548c8 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddIndividualScheduleUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.AddIndividualScheduleRequest import team.comit.simtong.domain.schedule.spi.CommandSchedulePort import team.comit.simtong.domain.schedule.spi.ScheduleQueryUserPort @@ -17,11 +13,11 @@ import team.comit.simtong.domain.schedule.spi.ScheduleSecurityPort import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class AddIndividualScheduleUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt index 43764aac..29d61ec3 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/AddSpotScheduleUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.AddSpotScheduleRequest import team.comit.simtong.domain.schedule.spi.CommandSchedulePort import team.comit.simtong.domain.schedule.spi.ScheduleQueryUserPort @@ -18,11 +14,11 @@ import team.comit.simtong.domain.user.exception.NotEnoughPermissionException import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class AddSpotScheduleUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt index 4af2ef33..f968e58f 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeIndividualScheduleUseCaseTest.kt @@ -4,13 +4,9 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.Mock import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.ChangeIndividualScheduleRequest import team.comit.simtong.domain.schedule.exception.NotScheduleOwnerException import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException @@ -23,12 +19,12 @@ import team.comit.simtong.domain.schedule.spi.ScheduleSecurityPort import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.time.LocalTime import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangeIndividualScheduleUseCaseTest { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt index f64af9d4..1bff10cb 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/ChangeSpotScheduleUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.ChangeSpotScheduleRequest import team.comit.simtong.domain.schedule.exception.NotScheduleOwnerException import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException @@ -23,11 +19,11 @@ import team.comit.simtong.domain.user.exception.NotEnoughPermissionException import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangeSpotScheduleUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt index c0437ccb..a2bf36f9 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/EntireSpotScheduleUseCaseTests.kt @@ -3,22 +3,18 @@ package team.comit.simtong.domain.schedule.usecase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.dto.EntireSpotScheduleResponse import team.comit.simtong.domain.schedule.dto.SpotScheduleResponse import team.comit.simtong.domain.schedule.model.Scope import team.comit.simtong.domain.schedule.spi.QuerySchedulePort import team.comit.simtong.domain.schedule.vo.SpotSchedule +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class EntireSpotScheduleUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt index ad806413..15332376 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/schedule/usecase/RemoveSpotScheduleUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.schedule.exception.ScheduleNotFoundException import team.comit.simtong.domain.schedule.model.Schedule import team.comit.simtong.domain.schedule.model.Scope @@ -21,11 +17,11 @@ import team.comit.simtong.domain.user.exception.NotEnoughPermissionException import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User +import team.comit.simtong.global.annotation.SimtongTest import java.time.LocalDate import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class RemoveSpotScheduleUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt index 2be102a1..2c6af6e4 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/spot/usecase/ShowSpotListUseCaseTests.kt @@ -3,19 +3,15 @@ package team.comit.simtong.domain.spot.usecase import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.spot.dto.SpotResponse import team.comit.simtong.domain.spot.model.Spot import team.comit.simtong.domain.spot.spi.QuerySpotPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ShowSpotListUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt index fdabf92f..cd48e780 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/AdminSignInUseCaseTests.kt @@ -4,12 +4,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.user.dto.SignInRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException @@ -20,10 +16,11 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserJwtPort import team.comit.simtong.domain.user.spi.UserSecurityPort -import java.util.* +import team.comit.simtong.global.annotation.SimtongTest +import java.util.Date +import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class AdminSignInUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt index 4b3794ea..2f87f04d 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeEmailUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException import team.comit.simtong.domain.auth.exception.UsedEmailException @@ -22,10 +18,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.CommandUserPort import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangeEmailUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt index b54e50ac..5726b363 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeNicknameUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedNicknameException import team.comit.simtong.domain.user.dto.ChangeNicknameRequest import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,10 +14,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.CommandUserPort import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangeNicknameUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt index 03928694..de24507c 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangePasswordUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.user.dto.ChangePasswordRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,10 +14,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.CommandUserPort import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangePasswordUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt index c326002c..58d3f16c 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeProfileImageUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.file.exception.NotFoundFilePathException import team.comit.simtong.domain.file.spi.CheckFilePort import team.comit.simtong.domain.user.dto.ChangeProfileImageRequest @@ -19,10 +15,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.CommandUserPort import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ChangeProfileImageUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt index 208a0dc7..d313e126 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ChangeSpotUseCaseTests.kt @@ -9,7 +9,7 @@ import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.context.annotation.Import import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization +import team.comit.simtong.global.DomainPropertiesInitialization import team.comit.simtong.domain.spot.exception.SpotNotFoundException import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt index a322d891..ac930de0 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckEmailDuplicationUseCaseTests.kt @@ -4,17 +4,13 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedEmailException import team.comit.simtong.domain.user.spi.QueryUserPort +import team.comit.simtong.global.annotation.SimtongTest -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class CheckEmailDuplicationUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt index f3ad0496..662e1924 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckMatchedAccountUseCaseTests.kt @@ -4,18 +4,14 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.user.dto.CheckMatchedAccountRequest import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.spi.QueryUserPort +import team.comit.simtong.global.annotation.SimtongTest -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class CheckMatchedAccountUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt index 79fa0532..1345785b 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/CheckNicknameDuplicationUseCaseTests.kt @@ -4,17 +4,13 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.UsedNicknameException import team.comit.simtong.domain.user.spi.QueryUserPort +import team.comit.simtong.global.annotation.SimtongTest -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class CheckNicknameDuplicationUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt index e311773d..e34112c3 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/FindEmployeeNumberUseCaseTests.kt @@ -4,21 +4,17 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.user.dto.FindEmployeeNumberRequest import team.comit.simtong.domain.user.exception.UserNotFoundException import team.comit.simtong.domain.user.model.Authority import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.QueryUserPort -import java.util.* +import team.comit.simtong.global.annotation.SimtongTest +import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class FindEmployeeNumberUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt index ea009aa2..cb55bc37 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/ResetPasswordUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.kotlin.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException import team.comit.simtong.domain.auth.model.AuthCodeLimit @@ -21,10 +17,10 @@ import team.comit.simtong.domain.user.spi.CommandUserPort import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserQueryAuthCodeLimitPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class ResetPasswordUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt index 24a47b1d..eb263681 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignInUseCaseTests.kt @@ -4,12 +4,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.user.dto.SignInRequest import team.comit.simtong.domain.user.exception.DifferentPasswordException @@ -20,10 +16,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserJwtPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.* -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class SignInUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt index 252e1943..49f1c708 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/SignUpUseCaseTests.kt @@ -4,12 +4,8 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.auth.dto.TokenResponse import team.comit.simtong.domain.auth.exception.RequiredNewEmailAuthenticationException import team.comit.simtong.domain.auth.exception.UncertifiedEmailException @@ -29,10 +25,10 @@ import team.comit.simtong.domain.user.spi.UserQueryAuthCodeLimitPort import team.comit.simtong.domain.user.spi.UserQuerySpotPort import team.comit.simtong.domain.user.spi.UserQueryTeamPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.* -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class SignUpUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt index 2a28e6de..2e548111 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/user/usecase/UserInfoUseCaseTests.kt @@ -4,12 +4,8 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean -import org.springframework.context.annotation.Import -import org.springframework.test.context.junit.jupiter.SpringExtension -import team.comit.simtong.domain.DomainPropertiesInitialization import team.comit.simtong.domain.spot.exception.SpotNotFoundException import team.comit.simtong.domain.spot.model.Spot import team.comit.simtong.domain.user.exception.UserNotFoundException @@ -18,10 +14,10 @@ import team.comit.simtong.domain.user.model.User import team.comit.simtong.domain.user.spi.QueryUserPort import team.comit.simtong.domain.user.spi.UserQuerySpotPort import team.comit.simtong.domain.user.spi.UserSecurityPort +import team.comit.simtong.global.annotation.SimtongTest import java.util.UUID -@Import(DomainPropertiesInitialization::class) -@ExtendWith(SpringExtension::class) +@SimtongTest class UserInfoUseCaseTests { @MockBean diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt b/simtong-application/src/test/kotlin/team/comit/simtong/global/DomainPropertiesInitialization.kt similarity index 94% rename from simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt rename to simtong-application/src/test/kotlin/team/comit/simtong/global/DomainPropertiesInitialization.kt index c08ca758..da40551e 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/DomainPropertiesInitialization.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/global/DomainPropertiesInitialization.kt @@ -1,4 +1,4 @@ -package team.comit.simtong.domain +package team.comit.simtong.global import team.comit.simtong.global.DomainProperties import team.comit.simtong.global.DomainPropertiesPrefix diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/global/annotation/SimtongTest.kt b/simtong-application/src/test/kotlin/team/comit/simtong/global/annotation/SimtongTest.kt new file mode 100644 index 00000000..2be00887 --- /dev/null +++ b/simtong-application/src/test/kotlin/team/comit/simtong/global/annotation/SimtongTest.kt @@ -0,0 +1,13 @@ +package team.comit.simtong.global.annotation + +import org.junit.jupiter.api.extension.ExtendWith +import org.springframework.context.annotation.Import +import org.springframework.test.context.junit.jupiter.SpringExtension +import team.comit.simtong.global.DomainPropertiesInitialization + + +@Target(AnnotationTarget.CLASS) +@Retention(AnnotationRetention.RUNTIME) +@ExtendWith(SpringExtension::class) +@Import(DomainPropertiesInitialization::class) +annotation class SimtongTest