From 871106b3045f5b1757e4c46d9e879421d2441297 Mon Sep 17 00:00:00 2001 From: dudxo Date: Tue, 20 Aug 2024 00:48:43 +0900 Subject: [PATCH] =?UTF-8?q?[test]=20:=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=8B=9C=20=EA=B8=B0=EC=A1=B4=20=EC=BF=A0=ED=82=A4?= =?UTF-8?q?=EA=B0=80=20=EC=82=AD=EC=A0=9C=EB=90=98=EB=8A=94=EC=A7=80=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dnd/gongmuin/auth/service/AuthServiceTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/dnd/gongmuin/auth/service/AuthServiceTest.java b/src/test/java/com/dnd/gongmuin/auth/service/AuthServiceTest.java index ad3f4cc2..b5bec608 100644 --- a/src/test/java/com/dnd/gongmuin/auth/service/AuthServiceTest.java +++ b/src/test/java/com/dnd/gongmuin/auth/service/AuthServiceTest.java @@ -173,6 +173,7 @@ void logout() { Authentication authentication = new UsernamePasswordAuthenticationToken(principal, "test"); MockHttpServletRequest mockRequest = new MockHttpServletRequest(); + MockHttpServletResponse mockResponse = new MockHttpServletResponse(); mockRequest.setCookies(new Cookie("Authorization", "testtesttesttest")); given(cookieUtil.getCookieValue(mockRequest)).willReturn("testtesttesttest"); @@ -185,10 +186,11 @@ void logout() { willDoNothing().given(redisUtil).setValues(anyString(), anyString(), any(Duration.class)); // when - LogoutResponse response = authService.logout(mockRequest); + LogoutResponse response = authService.logout(mockRequest, mockResponse); // then assertThat(response.result()).isTrue(); + assertThat(mockResponse.getCookies()).isEmpty(); } @DisplayName("refresh 토큰이 만료되지 않았다면 재발급 할 수 있다.")