chore: update
Java CI with Maven / test (pull_request) Successful in 7m54s
Java CI with Maven / build (pull_request) Successful in 27m48s

This commit is contained in:
TakahashiNg
2026-05-12 01:45:58 +00:00
parent 2f6f22941d
commit 82b0c88fcc
2 changed files with 6 additions and 3 deletions
@@ -161,7 +161,7 @@ public class ShiftService {
@Description("Quản lý xóa một ca trực") @Description("Quản lý xóa một ca trực")
@RolesAllowed(Role.Manager) @RolesAllowed(Role.Manager)
@Transactional @Transactional
public boolean deleteShift(@Name("id") Long id) throws GraphQLException { public boolean deleteShift(@Name("id") UUID id) throws GraphQLException {
String ownerId = request.getHeader(InternalValue.userId); String ownerId = request.getHeader(InternalValue.userId);
EateryEntity eatery = EateryEntity.findByOwnerId(ownerId); EateryEntity eatery = EateryEntity.findByOwnerId(ownerId);
@@ -145,6 +145,8 @@ public class ShiftServiceTest {
given() given()
.contentType("application/json") .contentType("application/json")
.header(InternalValue.userId, staffId.toString()) .header(InternalValue.userId, staffId.toString())
.header(InternalValue.managerId, ownerId.toString())
.header(InternalValue.role, Role.Staff)
.body("{ \"query\": \"" + mutation + "\" }") .body("{ \"query\": \"" + mutation + "\" }")
.when() .when()
.post("/graphql") .post("/graphql")
@@ -164,8 +166,7 @@ public class ShiftServiceTest {
"12:00:00", "12:00:00",
eatery eatery
); );
UUID staffId = UUID.randomUUID(); registerStaffToShift(UUID.randomUUID(), shift);
registerStaffToShift(staffId, shift);
String mutation = String.format( String mutation = String.format(
"mutation { deleteShift(id: \\\"%s\\\") }", "mutation { deleteShift(id: \\\"%s\\\") }",
@@ -173,6 +174,8 @@ public class ShiftServiceTest {
); );
given() given()
.header(InternalValue.userId, ownerId.toString())
.header(InternalValue.role, Role.Manager)
.contentType("application/json") .contentType("application/json")
.body("{ \"query\": \"" + mutation + "\" }") .body("{ \"query\": \"" + mutation + "\" }")
.when() .when()