java - org/apache/http/protocol/HTTP error when using Rest Assured -


my code snipped is:

@test public void connectiontestwithrestassured() {      given().         contenttype("application/json").     when().         get("http://localhost:8080/dictionaries").     then().         statuscode(200); } 

getting following error:

java.lang.noclassdeffounderror: org/apache/http/protocol/http     @ com.jayway.restassured.config.encoderconfig.<init>(encoderconfig.java:48)     @ com.jayway.restassured.config.restassuredconfig.<init>(restassuredconfig.java:41)     @ com.jayway.restassured.restassured.<clinit>(restassured.java:423)     @ com.adobe.test.dictionary.getdictionary.connectiontestwithrestassured(getdictionary.java:33)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source)     @ java.lang.reflect.method.invoke(unknown source)     @ org.testng.internal.methodinvocationhelper.invokemethod(methodinvocationhelper.java:100)     @ org.testng.internal.invoker.invokemethod(invoker.java:646) 

i have tried adding these lib: httpcore,httpclient, httpmime not working @ please help.

enter image description here

simplest way fix "add library" -> "server runtime" -> choose server, e.g. wildfly 10.0 runtime

if want see included jars see them in package explorer , extract/copy them project folder context action "copy classpath libraries"


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -