public void testCallsRollbackIfSendingAuthResponseFails() throws Exception {
final MockSender sender = new MockSender();
final MockSession session = new MockSession() {
@Override
public DASAuthObj authorize(final DASAuthObj authObj) {
mgr.dispatch( ... // AGHAGHAGH!
return super.authorize(authObj);
}
};
final DASSessionManager mgr = new DASSessionManager(session, sender);
...
public void testCallsRollbackIfSendingAuthResponseFails() throws Exception {
final MockSender sender = new MockSender();
final DASSessionManager[] mgrHolder = new DASSessionManager[1];
final MockSession session = new MockSession() {
@Override
public DASAuthObj authorize(final DASAuthObj authObj) {
mgrHolder[0].dispatch(new DASCloseAuthSinkPacket(1, true, 42));
return super.authorize(authObj);
}
};
final DASSessionManager mgr = new DASSessionManager(session, sender);
mgrHolder[0] = mgr;