@Test
public void shouldIncludeOAuthAndQueryAndBodyParams() throws Exception {
// mock a request that has custom query, body, and header params set
HttpRequest request = mock(HttpRequest.class);
when(request.getRequestUrl()).thenReturn("http://example.com?a=1+1");
ByteArrayInputStream body = new ByteArrayInputStream("b=2+2".getBytes());
when(request.getMessagePayload()).thenReturn(body);
when(request.getContentType()).thenReturn(
"application/x-www-form-urlencoded; charset=ISO-8859-1");
when(request.getHeader("Authorization")).thenReturn(
"OAuth realm=\"http%3A%2F%2Fexample.com\", oauth_token=\"12%25345\", oauth_signature=\"1234\"");
OAuthMessageSigner signer = mock(HmacSha1MessageSigner.class);
consumer.setMessageSigner(signer);