Hi all,
I am using testNG+rest-assured+spring boot for API testing. But always got 403 error with msg is "No valid crumb was included in the request". Actually I don't need to any CSRF.
I get exepected result with same reqeust by postman.
--header 'Content-Type: text/plain' \
--data-raw 'gs://service1/hk/dev/develop/routes.yml'
The scripts by spring boot is
given()
.body("gs://service1/hk/dev/develop/routes.yml")
.when()
.post("
http://localhost:8080/airway/configs")
.then()
.log().body();
build.gradle
dependencies
{
// implementation 'org.springframework.boot:spring-boot-starter'
// testImplementation('org.springframework.boot:spring-boot-starter-test') {
// exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
// }
implementation 'org.testng:testng:7.1.0'
implementation 'io.rest-assured:rest-assured:4.2.0'
implementation 'io.rest-assured:json-path:4.2.0'
implementation 'io.rest-assured:xml-path:4.2.0'
implementation 'io.rest-assured:rest-assured-common:4.2.0'
implementation 'io.rest-assured:rest-assured-all:4.2.0'
testImplementation('org.testng:testng:7.1.0')
testImplementation('io.rest-assured:rest-assured:4.2.0')
testImplementation('io.rest-assured:json-path:4.2.0')
testImplementation('io.rest-assured:xml-path:4.2.0')
testImplementation('io.rest-assured:rest-assured-common:4.2.0')
testImplementation('io.rest-assured:rest-assured-all:4.2.0')
}
Does anyone know how to resolve this issue?
Thanks.