.andExpect(method(POST))
.andExpect(content().string(expectedClientParams + "code=code&redirect_uri=http%3A%2F%2Fwww.someclient.com%2Fcallback&grant_type=authorization_code"));
if (expectedAuthorizationHeader != null) {
responseActions.andExpect(header("Authorization", expectedAuthorizationHeader));
}
responseActions.andRespond(withSuccess(new ClassPathResource(responseFile, getClass()), MediaType.APPLICATION_JSON));
return oauthTemplate.exchangeForAccess("code", "http://www.someclient.com/callback", null);
}
private AccessGrant passwordGrant_paramBasedClientAuth(String responseFile) {
return passwordGrant(oAuth2TemplateParamBased, "client_id=client_id&client_secret=client_secret&", null, responseFile);