final String uri = "/v1/auth/category/Test%20Category";
final String mimeType = "application/json";
final String expectedResponse = "{\"category\":{\"name\":\"Test Category\"}}";
new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, uri)
{
@Override
protected void prepareRequest(EnhancedMockHttpServletRequest request)
{
super.prepareRequest(request);
request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
}
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
super.onResponse(response);
assertEquals(response.getStatus(), 201, "Unexpected response code.");
}
}.run();
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, uri)
{
@Override
protected void prepareRequest(EnhancedMockHttpServletRequest request)
{