0
Good morning,
I’m doing Api Testing, as follows the example:
@Test
public void shouldStatus200_FindAll() {
RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
given().basePath("/receitas")
.port(port)
.accept(ContentType.JSON)
.when().get()
.then().statusCode(HttpStatus.OK.value());
}
As in the system has implemented Token, the test shows an authentication error, follows the error:
{
"error": "unauthorized",
"error_description": "Full authentication is required to access this resource"
}
How do I pass authentication in the test, to check correctly?