@Test(dependsOnMethods = {"shouldCreateMeasurement"})
public void shouldDeleteMeasurement() {
given().header(SESSION_TOKEN, sessionToken)
.contentType("application/json,text/plain")
.header(SECTION, "aaa")
.param("operation", "aaa")
.param("measurementId", guid).log().all()
.delete("/api/dddd/" + guid).then().log().all() .assertThat().statusCode(200);
}
The entity gets deleted, but am getting an error message:
Sep 27, 2017 11:33:46 AM com.jayway.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder parseResponse
WARNING: Could not parse content-type: Response does not have a content-type header
com.jayway.restassured.internal.http.ResponseParseException: OK
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:232)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:252)
at com.jayway.restassured.internal.RequestSpecificationImpl$RestAssuredHttpBuilder.doRequest(RequestSpecificationImpl.groovy:1808)
Anyway to resolve this?
I have added this in base class :
RestAssured.registerParser("text/plain", Parser.JSON);
Thanks,
Poonkuzhali