From cde9535ec6dd4fa5b75694a1595dbb3d4acd74b5 Mon Sep 17 00:00:00 2001 From: 210-reverof Date: Fri, 30 Aug 2024 03:40:01 +0900 Subject: [PATCH] chore: remove unused test --- .../mashup/pic/fake/FakeIdTokenValidator.kt | 16 ----- .../GroupApplicationServiceTest.kt | 59 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 pic-api/src/test/kotlin/com/mashup/pic/fake/FakeIdTokenValidator.kt delete mode 100644 pic-api/src/test/kotlin/com/mashup/pic/group/applicationservice/GroupApplicationServiceTest.kt diff --git a/pic-api/src/test/kotlin/com/mashup/pic/fake/FakeIdTokenValidator.kt b/pic-api/src/test/kotlin/com/mashup/pic/fake/FakeIdTokenValidator.kt deleted file mode 100644 index 3bc2cd2..0000000 --- a/pic-api/src/test/kotlin/com/mashup/pic/fake/FakeIdTokenValidator.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.mashup.pic.fake - -import com.mashup.pic.security.oidc.IdTokenValidator -import org.springframework.context.annotation.Profile -import org.springframework.stereotype.Component - -@Component -@Profile("test") -class FakeIdTokenValidator : IdTokenValidator { - override fun validateAndGetId( - idToken: String, - nickname: String - ): String { - TODO("Do Nothing in testing environment") - } -} diff --git a/pic-api/src/test/kotlin/com/mashup/pic/group/applicationservice/GroupApplicationServiceTest.kt b/pic-api/src/test/kotlin/com/mashup/pic/group/applicationservice/GroupApplicationServiceTest.kt deleted file mode 100644 index efedf63..0000000 --- a/pic-api/src/test/kotlin/com/mashup/pic/group/applicationservice/GroupApplicationServiceTest.kt +++ /dev/null @@ -1,59 +0,0 @@ -package com.mashup.pic.group.applicationservice - -import com.mashup.pic.ApplicationServiceTestSupport -import com.mashup.pic.domain.group.GroupKeyword -import com.mashup.pic.domain.user.LoginProvider -import com.mashup.pic.domain.user.User -import com.mashup.pic.domain.user.UserRepository -import com.mashup.pic.group.applicationservice.dto.CreateGroupResponse -import com.mashup.pic.group.applicationservice.dto.CreateGroupServiceRequest -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.transaction.annotation.Transactional - -@Transactional -class GroupApplicationServiceTest : ApplicationServiceTestSupport { - @Autowired - private lateinit var groupApplicationService: GroupApplicationService - - @Autowired - private lateinit var userRepository: UserRepository - - @DisplayName("Group을 생성할 수 있다.") - @Test - fun createWithJoin() { - // given - val user = createSampleUser() - val keyword = GroupKeyword.CREW - val groupName = "Sample Group Name" - val groupImageUrl = "http://www.sample.com/group-image.png" - val request = - CreateGroupServiceRequest( - userId = user.id, - groupName = groupName, - keyword = keyword, - groupImageUrl = groupImageUrl - ) - - // when - val createGroupResponse = groupApplicationService.create(request) - - // then - assertThat(createGroupResponse).isInstanceOf(CreateGroupResponse::class.java) - assertThat(createGroupResponse.groupName).isEqualTo(groupName) - assertThat(createGroupResponse.keyword).isEqualTo(keyword) - assertThat(createGroupResponse.groupImageUrl).isEqualTo(groupImageUrl) - } - - private fun createSampleUser( - oAuthId: String = "sampleid", - provider: LoginProvider = LoginProvider.KAKAO, - nickname: String = "User", - profileImage: String = "http://www.sample.com/profile-image.png" - ): User { - val user = User(oAuthId = oAuthId, provider = provider, nickname = nickname, profileImage = profileImage) - return userRepository.save(user) - } -}