use of org.apache.sling.servlets.post.JSONResponse in project sling by apache.
the class SlingPostServletTest method testGetJsonResponse.
public void testGetJsonResponse() {
MockSlingHttpServletRequest req = new MockSlingHttpServlet3Request(null, null, null, null, null) {
@Override
public String getHeader(String name) {
return name.equals(MediaRangeList.HEADER_ACCEPT) ? "application/json" : super.getHeader(name);
}
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
return null;
}
};
PostResponse result = servlet.createPostResponse(req);
assertTrue(result instanceof JSONResponse);
}
Aggregations