Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wip test

  • Loading branch information...
commit 706b6313cd55651548d12c58275dedb7e84ec491 1 parent 10a8bd0
@ghosthack authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/test/java/content/{TestApi.java → TestContentApi.java}
View
13 src/test/java/content/TestApi.java → src/test/java/content/TestContentApi.java
@@ -26,14 +26,14 @@
import com.google.gson.Gson;
-public class TestApi {
+public class TestContentApi {
static {
- PropertyConfigurator.configure(TestApi.class.getResource("/logging.properties"));
+ PropertyConfigurator.configure(TestContentApi.class.getResource("/logging.properties"));
}
public static void main(String args[]) throws Exception {
- TestApi test = new TestApi();
+ TestContentApi test = new TestContentApi();
test.all();
}
@@ -83,8 +83,13 @@ public void testRender1Element() throws Exception {
HttpServletRequest req = mockReq("GET", "/render/" + id);
MockHttpServletResponse res = mockRes();
+ String expected = "text/html";
+ when(req.getHeader("Accept")).thenReturn(expected);
+
ContentHandler.create(context).service(req, res);
assertEquals(res.getStringWriter().toString(), "This is a test string: Test");
+
+ assertEquals(res.getContentType(), expected);
assertEquals(res.getStatus(), 200);
}
@@ -200,6 +205,6 @@ private ElementModify createSampleModify(int id) {
return element;
}
- private final Logger log = Logger.getLogger(TestApi.class);
+ private final Logger log = Logger.getLogger(TestContentApi.class);
}
Please sign in to comment.
Something went wrong with that request. Please try again.