@Test(expected = DuplicatedProtocolParametersException.class) public void extractProtocolParameters_duplicatedProtocolName() throws Exception { Parameters parameters = new ParameterList(); parameters.addValue("foo", "bar"); parameters.addValue(oauth_token, "wabol"); parameters.addValue(oauth_token, "wabol!"); OAuthParameters.extractProtocolParameters(parameters); }
@Test public void extractProtocolParameters() throws Exception { Parameters parameters = new ParameterList(); parameters.addValue("foo", "bar"); parameters.addValue(oauth_token, "wabol"); Parameters extracted = OAuthParameters.extractProtocolParameters(parameters); Entry<String, String> parameter = new SimpleImmutableEntry<String, String>(oauth_token, "wabol"); assertThat(extracted, hasItem(parameter)); }