OAuthClientRequest request = OAuthClientRequest
.tokenLocation(Common.ACCESS_TOKEN_ENDPOINT)
.setClientId(Common.CLIENT_ID)
.buildBodyMessage();
OAuthClient oAuthClient = new OAuthClient(new URLConnectionClient());
try {
oAuthClient.accessToken(request);
fail("exception expected");
} catch (OAuthProblemException e) {
assertEquals(OAuthError.TokenResponse.INVALID_REQUEST, e.getError());
}
}