fix(account-service): handle empty user id
Java CI with Maven / build-and-test (pull_request) Failing after 27m2s

This commit is contained in:
TakahashiNg
2026-04-07 14:01:26 +00:00
parent f08499b346
commit c3aa71face
2 changed files with 5 additions and 2 deletions
@@ -15,6 +15,10 @@ public class CustomerService {
@Path(Url.Me)
@Transactional
public Response me(@HeaderParam(Jwt.userId) UUID id) {
if (id == null) return Response.status(Response.Status.BAD_REQUEST)
.entity("InvalidUserId")
.build();
return Response.ok(CustomerEntity.find("id", id).firstResult()).build();
}
}
@@ -45,7 +45,6 @@ public class CustomberServiceTest {
.when()
.post(Url.Me)
.then()
// Tùy vào logic xử lý của bạn, có thể trả về 200 kèm body null hoặc 400
.statusCode(200);
.statusCode(400);
}
}