From 256db71231e33334938b47227abeb2f1c8dd406e Mon Sep 17 00:00:00 2001 From: Dabeen Jeong Date: Thu, 3 Aug 2023 10:11:17 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20fix:=20=EA=B8=B0=EC=A1=B4=20=ED=9A=8C?= =?UTF-8?q?=EC=9B=90=EC=9D=80=20=ED=99=88=EC=9C=BC=EB=A1=9C,=20=EC=8B=A0?= =?UTF-8?q?=EA=B7=9C=20=ED=9A=8C=EC=9B=90=EC=9D=80=20=EB=A7=88=EC=9D=B4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20(#2?= =?UTF-8?q?41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/funeat/auth/dto/SignUserDto.java | 14 +++++++------- .../auth/presentation/AuthApiController.java | 6 +++--- .../auth/presentation/AuthApiControllerTest.java | 4 ++-- .../member/application/MemberServiceTest.java | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/com/funeat/auth/dto/SignUserDto.java b/backend/src/main/java/com/funeat/auth/dto/SignUserDto.java index 170ef9591..2e910ee77 100644 --- a/backend/src/main/java/com/funeat/auth/dto/SignUserDto.java +++ b/backend/src/main/java/com/funeat/auth/dto/SignUserDto.java @@ -4,20 +4,20 @@ public class SignUserDto { - private final boolean isSignIn; + private final boolean isSignUp; private final Member member; - public SignUserDto(final boolean isSignIn, final Member member) { - this.isSignIn = isSignIn; + public SignUserDto(final boolean isSignUp, final Member member) { + this.isSignUp = isSignUp; this.member = member; } - public static SignUserDto of(final boolean isSignIn, final Member member) { - return new SignUserDto(isSignIn, member); + public static SignUserDto of(final boolean isSignUp, final Member member) { + return new SignUserDto(isSignUp, member); } - public boolean isSignIn() { - return isSignIn; + public boolean isSignUp() { + return isSignUp; } public Member getMember() { diff --git a/backend/src/main/java/com/funeat/auth/presentation/AuthApiController.java b/backend/src/main/java/com/funeat/auth/presentation/AuthApiController.java index 98c1a9f29..dc7aadf8b 100644 --- a/backend/src/main/java/com/funeat/auth/presentation/AuthApiController.java +++ b/backend/src/main/java/com/funeat/auth/presentation/AuthApiController.java @@ -35,13 +35,13 @@ public ResponseEntity loginAuthorizeUser(@RequestParam("code") final Strin final Long memberId = signUserDto.getMember().getId(); request.getSession().setAttribute("member", memberId); - if (signUserDto.isSignIn()) { + if (signUserDto.isSignUp()) { return ResponseEntity.ok() - .location(URI.create("/")) + .location(URI.create("/profile")) .build(); } return ResponseEntity.ok() - .location(URI.create("/profile")) + .location(URI.create("/")) .build(); } diff --git a/backend/src/test/java/com/funeat/auth/presentation/AuthApiControllerTest.java b/backend/src/test/java/com/funeat/auth/presentation/AuthApiControllerTest.java index 379a4c580..9e36ba822 100644 --- a/backend/src/test/java/com/funeat/auth/presentation/AuthApiControllerTest.java +++ b/backend/src/test/java/com/funeat/auth/presentation/AuthApiControllerTest.java @@ -33,7 +33,7 @@ class loginAuthorizeUser_테스트 { // given final var code = "test"; final var member = new Member("test", "www.test.com", "1"); - final var signUserDto = SignUserDto.of(true, member); + final var signUserDto = SignUserDto.of(false, member); // when when(authService.loginWithKakao(code)).thenReturn(signUserDto); @@ -50,7 +50,7 @@ class loginAuthorizeUser_테스트 { // given final var code = "test"; final var member = new Member("test", "www.test.com", "1"); - final var signUserDto = SignUserDto.of(false, member); + final var signUserDto = SignUserDto.of(true, member); // when when(authService.loginWithKakao(code)).thenReturn(signUserDto); diff --git a/backend/src/test/java/com/funeat/member/application/MemberServiceTest.java b/backend/src/test/java/com/funeat/member/application/MemberServiceTest.java index c79ccfe05..f5ed7f1a5 100644 --- a/backend/src/test/java/com/funeat/member/application/MemberServiceTest.java +++ b/backend/src/test/java/com/funeat/member/application/MemberServiceTest.java @@ -50,7 +50,7 @@ class findOrCreateMember_테스트 { // then assertSoftly(softAssertions -> { - Assertions.assertFalse(actual.isSignIn()); + Assertions.assertFalse(actual.isSignUp()); assertThat(expected).containsExactly(actual.getMember()); }); } @@ -69,7 +69,7 @@ class findOrCreateMember_테스트 { // then assertSoftly(softAssertions -> { - Assertions.assertTrue(actual.isSignIn()); + Assertions.assertTrue(actual.isSignUp()); assertThat(expected).doesNotContain(actual.getMember()); }); }