public void should_access_secured_resource_with_http_basic() throws Exception {
HttpTestClient client = server.client();
HttpRequest httpRequest = client.GET("/api/security/user")
.basic("admin", Hashing.md5().hashString("juma", Charsets.UTF_8).toString());
assertThat(httpRequest.code()).isEqualTo(200);
assertThat(httpRequest.headers("Set-Cookie")[1]).contains("\"principal\":\"admin\"");
assertThat(httpRequest.body().trim()).isEqualTo("admin");
}
@Test
public void should_not_access_secured_resource_with_http_basic_when_deactivated() throws Exception {