2016-11-10 3 views
0

meinen Code Assured snipped ist:org/Apache/http/Protokoll/HTTP-Fehler bei Verwendung von Rast

@Test 
public void connectionTestWithRestAssured() { 
    given(). 
     contentType("application/json"). 
    when(). 
     get("http://localhost:8080/dictionaries"). 
    then(). 
     statusCode(200); 
} 

folgende Störung zu erhalten:

java.lang.NoClassDefFoundError: org/apache/http/protocol/HTTP 
    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.adobe.test.dictionary.GetDictionary.connectionTestWithRestAssured(GetDictionary.java:33) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) 
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:646) 

Ich habe versucht, diese lib fügte hinzu: httpcore, Httpclient , httpmime aber es funktioniert überhaupt nicht bitte helfen.

enter image description here

+0

Können Sie einen Versuch mit der neuesten Version von [ruhiges] (http://central.maven.org/maven2/io/rest-assured/rest-assured/3.0.1/rest-assured-3.0.1.jar) – Ramu

Antwort

0

einfachste Weg, dies zu beheben, ist auf "Bibliothek hinzufügen" -> "Server-Laufzeit" -> wählen Sie Ihren Server, zum Beispiel Wildfly 10,0 Runtime

Wenn Sie enthalten Gläser sehen wollen, könnte man sie in Paket-Explorer sehen und sogar extrahieren/kopieren Sie Ordner durch den Kontext Aktion „Copy Classpath Bibliotheken“ zu projizieren

Verwandte Themen