publishAuth("server1", "john", "password1", "readwrite");
publishAuth("server1", "jane", "password2", "readwrite");
String data;
data = jsonBuilder().startObject().field("blip", 1).endObject().string();
HttpClient http = httpClient("server1", "john", "password1");
HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
assertThat(resp.errorCode(), equalTo(201));
http = httpClient("server1", "jane", "password2");
resp = http.request("PUT", "/foo/bar/2", data.getBytes());
assertThat(resp.errorCode(), equalTo(201));
http = httpClient("server1", "john", "password2");
resp = http.request("PUT", "/foo/bar/3", data.getBytes());
assertThat(resp.errorCode(), equalTo(401));
http = httpClient("server1", "jane", "password1");
resp = http.request("PUT", "/foo/bar/4", data.getBytes());
assertThat(resp.errorCode(), equalTo(401));
http = httpClient("server1", "JaNe", "password2");
resp = http.request("PUT", "/foo/bar/4", data.getBytes());
assertThat(resp.errorCode(), equalTo(401));
}