}), with(same(getOAuthConsumerByConsumerKeyAction)));
will(returnValue(consumer));
}
});
ConsumerDetails result = sut.loadConsumerByConsumerKey("KEY");
context.assertIsSatisfied();
assertEquals("KEY", result.getConsumerKey());
assertNotNull(result.getConsumerName());
assertEquals("SECRET", ((SharedConsumerSecret) result.getSignatureSecret()).getConsumerSecret());
GrantedAuthority[] auths = result.getAuthorities();
assertEquals(2, auths.length);
assertEquals("ROLE1", auths[0].getAuthority());
assertEquals("ROLE2", auths[1].getAuthority());
}