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)); }