在我的应用程序中,我需要在获取呼叫之前将承载令牌发送为authorization
我尝试过此
RestAssured.given().auth().oauth2(token).when().get("/search").then().assertThat().statusCode(200);
这应该工作
RestAssured.given().header("Authorization", "bearer " + token).when().get("/search").then().assertThat().statusCode(200);