I am a beginner, and am trying to check response for given url. I have written a very simple code, but am recieving an exception. I have tried a lot of things, but I have not been able to resolve it. Please help me.
Code:
public class RestAPITest {
@Test
public void test() {
final String url = "http//:127.0.0.1:8080/myproject/api/";
given().parameter("HEADER_NAME", "X-Auth-Token", "MY_DEFAULT_TOKEN", "_MY_REST_TOKEN").
contentType("application/json; charset=UTF-16").when().get(url).then().statusCode(200);
}
}
Exception Occured:
java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
at com.jayway.restassured.config.EncoderConfig.<init>(EncoderConfig.java:48)
at com.jayway.restassured.config.RestAssuredConfig.<init>(RestAssuredConfig.java:41)
at com.jayway.restassured.RestAssured.<clinit>(RestAssured.java:423)
at com.rest.RestAPITest.test(RestAPITest.java:59)