private OSEAuthConfigContributor contrib, exceptionContrib;
@Before
public void setup() throws Exception {
SecurityTokenCodec codec = createNiceMock(SecurityTokenCodec.class);
expect(codec.encodeToken(anyObject(SecurityToken.class))).andReturn("IAmASecurityToken")
.anyTimes();
replay(codec);
this.contrib = new OSEAuthConfigContributor(codec);
SecurityTokenCodec exceptionCodec = createNiceMock(SecurityTokenCodec.class);
expect(exceptionCodec.encodeToken(anyObject(SecurityToken.class))).andThrow(
new SecurityTokenException("Catch me!")).anyTimes();
replay(exceptionCodec);
this.exceptionContrib = new OSEAuthConfigContributor(exceptionCodec);
}