public void shouldRequestCSRFToken() throws Exception {
doReturn("").when(client).executeRequest(any(HttpPost.class));
doReturn(SECURITY_TOKEN_RESPONSE).when(client).executeRequest(any(HttpGet.class));
client.doRequest(new HttpPost(server));
Header authHeader = BasicScheme.authenticate(client.credentials, "utf-8", false);
verify(client).executeRequest(argThat(new HttpRequestHeaderMatcher(authHeader.getName(), authHeader.getValue())));
}