chore: update
Java CI with Maven / build-and-test (pull_request) Failing after 2m59s

This commit is contained in:
TakahashiNg
2026-05-07 02:48:46 +00:00
parent a4099c5612
commit 369f85c8f2
3 changed files with 19 additions and 0 deletions
@@ -1,10 +1,14 @@
package com.drinkool.services;
import com.drinkool.InternalValue;
import com.drinkool.Role;
import com.drinkool.dtos.DtoMapper;
import com.drinkool.entities.ReviewEntity;
import com.drinkool.enums.SortBy;
import com.drinkool.lib.dtos.SendReview;
import io.quarkus.panache.common.Sort;
import io.vertx.core.http.HttpServerRequest;
import jakarta.annotation.security.RolesAllowed;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.DefaultValue;
@@ -19,6 +23,9 @@ import java.util.UUID;
@Path("/api/review")
public class ReviewService {
@Inject
HttpServerRequest request;
@Inject
DtoMapper dtoMapper;
@@ -42,10 +49,14 @@ public class ReviewService {
}
@POST
@RolesAllowed(Role.Customer)
@Transactional
public Response receiveReview(SendReview input) {
UUID reviewerId = UUID.fromString(request.getHeader(InternalValue.userId));
try {
ReviewEntity entity = dtoMapper.toReviewEntity(input);
entity.setReviewerId(reviewerId);
entity.persist();
@@ -5,6 +5,8 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.jupiter.api.Assertions.*;
import com.drinkool.InternalValue;
import com.drinkool.Role;
import com.drinkool.entities.EateryEntity;
import com.drinkool.entities.ReviewEntity;
import com.drinkool.lib.dtos.SendReview;
@@ -91,6 +93,8 @@ public class ReviewServiceTest {
@Test
public void testGetReviews_DefaultLatest() {
given()
.header(InternalValue.role, Role.Customer)
.header(InternalValue.userId, UUID.randomUUID())
.when()
.get("/api/review/" + savedEateryId.toString())
.then()
@@ -19,4 +19,8 @@ public class SendReview implements ReviewInterface {
private UUID eateryId;
private Integer rating;
private String comment;
public void setReviewerId(UUID x) {
return;
}
}