You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void checkPlmOnlineStatus() {
assertOk(response);
int responseCode = response.getStatus();
System.out.println(responseCode);
System.out.println(response.getBody());
}
}
Error:
java.lang.NullPointerException
at com.github.kevinsawicki.http.HttpRequest$CloseOperation.done(HttpRequest.java:647)
at com.github.kevinsawicki.http.HttpRequest$Operation.call(HttpRequest.java:608)
at com.github.kevinsawicki.http.HttpRequest.copy(HttpRequest.java:2380)
at com.github.kevinsawicki.http.HttpRequest.send(HttpRequest.java:2727)
at com.eclipsesource.restfuse.internal.InternalRequest.post(InternalRequest.java:76)
at com.eclipsesource.restfuse.internal.HttpTestStatement.callService(HttpTestStatement.java:119)
at com.eclipsesource.restfuse.internal.HttpTestStatement.sendRequest(HttpTestStatement.java:105)
at com.eclipsesource.restfuse.internal.BasicStatement.evaluate(BasicStatement.java:30)
at com.eclipsesource.restfuse.internal.HttpTestStatement.doEvaluate(HttpTestStatement.java:84)
at com.eclipsesource.restfuse.internal.HttpTestStatement.evaluate(HttpTestStatement.java:64)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
The text was updated successfully, but these errors were encountered:
File
/**
*/
package com.colehaan.wc.integration.webservice.test;
import static com.eclipsesource.restfuse.Assert.assertOk;
import org.junit.Rule;
import org.junit.runner.RunWith;
import com.eclipsesource.restfuse.AuthenticationType;
import com.eclipsesource.restfuse.Destination;
import com.eclipsesource.restfuse.HttpJUnitRunner;
import com.eclipsesource.restfuse.Method;
import com.eclipsesource.restfuse.Response;
import com.eclipsesource.restfuse.annotation.Authentication;
import com.eclipsesource.restfuse.annotation.Context;
import com.eclipsesource.restfuse.annotation.HttpTest;
import junit.framework.TestCase;
/**
@author 13160
*
*/
@RunWith(HttpJUnitRunner.class)
public class TestCHWebService extends TestCase {
@context
private Response response; // will be injected after every request
@rule
public Destination restfuse = getDestination();
private Destination getDestination() {
Destination destination = new Destination(this, "http://plmd.colehaan.net/Windchill/servlet/rest/webservice/mediabin");
destination.getRequestContext().addHeader("Content-Type", "application/json");
System.out.println(destination);
return destination;
}
@httptest(method = Method.POST, path = "/getLineDrawingMetaData", authentications = {
@authentication(user = "wcadmin", password = "wcadmin", type = AuthenticationType.BASIC) })
public void checkPlmOnlineStatus() {
assertOk(response);
}
}
Error:
java.lang.NullPointerException
at com.github.kevinsawicki.http.HttpRequest$CloseOperation.done(HttpRequest.java:647)
at com.github.kevinsawicki.http.HttpRequest$Operation.call(HttpRequest.java:608)
at com.github.kevinsawicki.http.HttpRequest.copy(HttpRequest.java:2380)
at com.github.kevinsawicki.http.HttpRequest.send(HttpRequest.java:2727)
at com.eclipsesource.restfuse.internal.InternalRequest.post(InternalRequest.java:76)
at com.eclipsesource.restfuse.internal.HttpTestStatement.callService(HttpTestStatement.java:119)
at com.eclipsesource.restfuse.internal.HttpTestStatement.sendRequest(HttpTestStatement.java:105)
at com.eclipsesource.restfuse.internal.BasicStatement.evaluate(BasicStatement.java:30)
at com.eclipsesource.restfuse.internal.HttpTestStatement.doEvaluate(HttpTestStatement.java:84)
at com.eclipsesource.restfuse.internal.HttpTestStatement.evaluate(HttpTestStatement.java:64)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
The text was updated successfully, but these errors were encountered: