Files
backend/eatery-service/src/test/java/com/drinkool/services/InventoryServiceTest.java
T
TranHuuDanh 5a7b70145c
Release package / release (push) Successful in 10m45s
feature/danh-dev-new-branch-yeu-cau-viet-anh (#14)
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com>
Co-authored-by: TranHuuDanh <tranhuudanh@demonkernel.io.vn>
Co-authored-by: TakahashiNguyen <takahashi.ng@icloud.com>
Reviewed-on: #14
Reviewed-by: TakahashiNguyen <takahashi.ng@icloud.com>
Co-authored-by: TranHuuDanh <tranhuudanh@noreply.localhost>
Co-committed-by: TranHuuDanh <tranhuudanh@noreply.localhost>
2026-04-01 08:20:41 +00:00

35 lines
748 B
Java

package com.drinkool.services;
import static io.restassured.RestAssured.given;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.drinkool.dtos.AddInventory;
import com.drinkool.entities.InventoryItemEntity;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
import java.util.UUID;
import org.junit.jupiter.api.Test;
@QuarkusTest
public class InventoryServiceTest {
@Test
void add() {
String name = UUID.randomUUID().toString();
AddInventory input = new AddInventory();
input.name = name;
given()
.contentType(ContentType.JSON)
.body(input)
.when()
.post("/api/inventory/create")
.then();
assertEquals(1, InventoryItemEntity.find("name", name).count());
}
}