package de.taimos.springcxfdaemon.test;

import javax.ws.rs.core.Response.Status;

import org.apache.http.HttpResponse;
import org.junit.Assert;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;

import de.taimos.daemon.spring.SpringDaemonTestRunner;
import de.taimos.httputils.HTTPRequest;
import de.taimos.httputils.WS;

@RunWith(SpringDaemonTestRunner.class)
public abstract class APITest {
	
	@Value("${server.url:http://localhost:${jaxrs.bindport:${svc.port:8080}}}")
	private String serverURL;
	
	
	protected final String getServerURL() {
		return this.serverURL;
	}
	
	protected final HTTPRequest request(String path) {
		return WS.url(this.serverURL + path);
	}
	
	protected final void assertOK(HttpResponse res) {
		Assert.assertTrue(WS.isStatusOK(res));
	}
	
	protected final void assertStatus(HttpResponse res, Status status) {
		Assert.assertTrue(WS.getStatus(res) == status.getStatusCode());
	}
	
}

@@ -778,16 +778,74 @@
 ertTrue(
+String.format(%22Expected OK - was %25s%22, WS.getStatus(res)), 
 WS.isSta
@@ -952,16 +952,98 @@
 ertTrue(
+String.format(%22Expected %25s - was %25s%22, status.getStatusCode(), WS.getStatus(res)), 
 WS.getSt

add error messages for test