原创

Quarkus测试中如何通过授权参数化QuarkusTest与TestSecurity

温馨提示:
本文最后更新于 2024年04月12日,已超过 37 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

我有这个测试

    @Test
public void testInvalidLimitExceptionMapping() {
    String errorMessage = "Invalid offset or limit values.";
    String json = mapErrorToJson(errorMessage);

    Mockito.when(orderService.getOrders(anyInt(), anyInt(), anyString()))
            .thenThrow(new InvalidParameterException(errorMessage));

    given()
            .when().get("/v1/orders?offset=5&limit=10&date=2023-04-03")
            .then()
            .statusCode(400)
            .body(is(json));
}

现在对端点进行身份验证后,它没有通过,我知道处理身份验证部分吗?

正文到此结束
热门推荐
本文目录