verify();
}
@Test
public void testTokenMultipleGadgetsWithSuccessAndFailure() throws Exception {
SecurityTokenCodec codec = EasyMock.createMock(SecurityTokenCodec.class);
EasyMock.expect(codec.encodeToken(EasyMock.isA(SecurityToken.class))).andReturn(TOKEN);
EasyMock.expect(codec.encodeToken(EasyMock.isA(SecurityToken.class))).andThrow(
new SecurityTokenException("blah"));
replay(codec);
registerGadgetsHandler(codec);
JSONObject request = makeTokenRequest(GADGET1_URL, GADGET2_URL);