From 84c988a9d179f875b049089ab0796b67fcc18d4b Mon Sep 17 00:00:00 2001 From: Lemonade255 Date: Mon, 23 Oct 2023 20:38:50 +0900 Subject: [PATCH] =?UTF-8?q?fix(BE):=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=98=A4=EB=A5=98=20BUS-202-MVP1-API-test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/api/user/adapter/out/persistence/UserEntity.java | 2 +- src/main/java/com/example/api/user/service/UserService.java | 1 + src/test/java/com/example/api/user/UserServiceTests.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/api/user/adapter/out/persistence/UserEntity.java b/src/main/java/com/example/api/user/adapter/out/persistence/UserEntity.java index 980e7d1..3595eec 100644 --- a/src/main/java/com/example/api/user/adapter/out/persistence/UserEntity.java +++ b/src/main/java/com/example/api/user/adapter/out/persistence/UserEntity.java @@ -21,7 +21,7 @@ public class UserEntity extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.UUID) - @Column(columnDefinition = "BINARY(24)") + @Column(columnDefinition = "BINARY(16)") private UUID userId; @OneToOne(fetch = FetchType.LAZY) diff --git a/src/main/java/com/example/api/user/service/UserService.java b/src/main/java/com/example/api/user/service/UserService.java index e38ce39..d3ff48a 100644 --- a/src/main/java/com/example/api/user/service/UserService.java +++ b/src/main/java/com/example/api/user/service/UserService.java @@ -84,6 +84,7 @@ public FindUserDto getUser() { log.error("UserService::getUser: Authentication is needed"); return this.getDefaultUser(); } + log.info("UserID: {}", securityUser.getUserId()); return findUserPort.getByUserId(securityUser.getUserId()) .map(userMapper::toDto) .orElse(this.getDefaultUser()); diff --git a/src/test/java/com/example/api/user/UserServiceTests.java b/src/test/java/com/example/api/user/UserServiceTests.java index 13787e5..4a49056 100644 --- a/src/test/java/com/example/api/user/UserServiceTests.java +++ b/src/test/java/com/example/api/user/UserServiceTests.java @@ -107,7 +107,7 @@ void getAllTest() { @Test void getUserByIdTest() { - userService.getUserById(userUUID); + userService.getUser(); verify(findUserPort, times(1)).getByUserId(UUID.fromString(userUUID)); }