@Test
public void shouldGetAnAuthorizationTokenBasedOnOAuthenticatorResult() throws Exception {

    List<EncodedPair> pairs = asList(
            toPreEncodedPair("a","a%20val"),
            toPreEncodedPair("b","b%20val")
    );
    when(mockOAuthenticator.oauth(any(OAuthToken.class), any(MethodType.class), anyString(), any(EncodedPair[].class))).thenReturn(pairs);
    MethodType argMethodType = GET;
    String argUrl = "url";
    EncodedPair argPair = toPreEncodedPair("c","c%20val");
    AuthorizationToken actual = toTest.authorize(argMethodType, argUrl, argPair);
    assertNotNull(actual);
    assertEquals("OAuth", actual.getName());
    assertEquals("a=\"a%20val\",b=\"b%20val\"", actual.getValue());
    verify(mockOAuthenticator).oauth(mockToken, argMethodType, argUrl, argPair);
}