From c856b5fdd7bc060047af85fb1af36f75a20f2b43 Mon Sep 17 00:00:00 2001 From: eom-tae-in Date: Sun, 14 Jul 2024 19:55:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test:=20redis=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdminRedisRefreshTokenRepositoryTest.java | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/test/java/com/atwoz/admin/infrastructure/auth/AdminRedisRefreshTokenRepositoryTest.java diff --git a/src/test/java/com/atwoz/admin/infrastructure/auth/AdminRedisRefreshTokenRepositoryTest.java b/src/test/java/com/atwoz/admin/infrastructure/auth/AdminRedisRefreshTokenRepositoryTest.java deleted file mode 100644 index 893f230d..00000000 --- a/src/test/java/com/atwoz/admin/infrastructure/auth/AdminRedisRefreshTokenRepositoryTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.atwoz.admin.infrastructure.auth; - -import com.atwoz.admin.domain.admin.AdminRefreshToken; -import com.atwoz.helper.IntegrationHelper; -import java.util.Optional; -import org.junit.jupiter.api.DisplayNameGeneration; -import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import static com.atwoz.admin.fixture.AdminRefreshTokenFixture.관리자_리프레쉬_토큰_생성; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.SoftAssertions.assertSoftly; - -@DisplayNameGeneration(ReplaceUnderscores.class) -@SuppressWarnings("NonAsciiCharacters") -class AdminRedisRefreshTokenRepositoryTest extends IntegrationHelper { - - @Autowired - private AdminRedisRefreshTokenRepository adminRedisRefreshTokenRepository; - - @Test - void 관리자_토큰_저장_및_조회() { - // given - AdminRefreshToken adminRefreshToken = 관리자_리프레쉬_토큰_생성(); - - // when - adminRedisRefreshTokenRepository.save(adminRefreshToken); - Optional foundAdminRefreshToken = - adminRedisRefreshTokenRepository.findById(adminRefreshToken.refreshToken()); - - // then - assertSoftly(softly -> { - softly.assertThat(foundAdminRefreshToken).isNotEmpty(); - AdminRefreshToken refreshToken = foundAdminRefreshToken.get(); - softly.assertThat(refreshToken.memberId()).isEqualTo(adminRefreshToken.memberId()); - softly.assertThat(refreshToken.refreshToken()).isEqualTo(adminRefreshToken.refreshToken()); - }); - } - - @Test - void 관리자_토큰_삭제() { - // given - AdminRefreshToken adminRefreshToken = 관리자_리프레쉬_토큰_생성(); - adminRedisRefreshTokenRepository.save(adminRefreshToken); - - // when - adminRedisRefreshTokenRepository.delete(adminRefreshToken.refreshToken()); - Optional after = adminRedisRefreshTokenRepository.findById(adminRefreshToken.refreshToken()); - - // then - assertThat(after).isEmpty(); - } -} From 91e71c836fe3a9814dc42ad22fe5686771523a70 Mon Sep 17 00:00:00 2001 From: eom-tae-in Date: Sun, 14 Jul 2024 19:56:01 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20redis=20host,=20port=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-local.yml | 5 +++++ src/main/resources/application-prod.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index a9c4950b..5601f332 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -5,6 +5,11 @@ spring: password: root driver-class-name: com.mysql.cj.jdbc.Driver + data: + redis: + host: localhost + port: 6379 + flyway: enabled: false baseline-on-migrate: false diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 651fab60..06be6446 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -5,6 +5,11 @@ spring: password: ENC(Vt4CpxfngX+cLFkAFmlCjw==) driver-class-name: com.mysql.cj.jdbc.Driver + data: + redis: + host: localhost + port: 6379 + flyway: enabled: false baseline-on-migrate: false