UndoableHandler handler = EasyMock.createMock(UndoableHandler.class);
handler.onEvent(EasyMock.isA(UndoableEvent.class));
EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
public Object answer() throws Throwable {
Object[] params = EasyMock.getCurrentArguments();
UndoableEvent event = (UndoableEvent) params[0];
assertNotNull("oldItems shouldn't be null", event.getData("oldItems"));
assertNotNull("newItems shouldn't be null", event.getData("newItems"));
assertNotNull("itemSelected shouldn't be null", event.getData("itemSelected"));
assertSame("oldProps and oldItems should be the same", oldProps, event.getData("oldItems"));
assertSame("newProps and newItems should be the same", newProps, event.getData("newItems"));
assertSame("formItem and itemSelected should be the same", formItem, event.getData("itemSelected"));
return null;
}
}).once();
bus.addHandler(UndoableEvent.TYPE, handler);
formItem.saveValues(EasyMock.same(newProps));