nodeInterceptor.setNext(dummy);
cache.setInterceptorChain(interceptor);
// first set up a node with a pojo
DummyTransactionManager mgr = DummyTransactionManager.getInstance();
mgr.begin();
Transaction tx = mgr.getTransaction();
// inject InvocationContext
cache.getInvocationContext().setTransaction(tx);
cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
SamplePojo pojo = new SamplePojo(21, "test");
cache.put("/one/two", "key1", pojo);
//overwrite the map we just put in
SamplePojo pojo2 = new SamplePojo(21, "test");
cache.put("/one/two", "key1", pojo2);
assertEquals(null, dummy.getCalled());
TransactionTable table = cache.getTransactionTable();
GlobalTransaction gtx = table.get(tx);
OptimisticTransactionEntry entry = (OptimisticTransactionEntry) table.get(gtx);
TransactionWorkspace workspace = entry.getTransactionWorkSpace();
mgr.commit();
//assert what should be the results of our call
assertEquals(3, workspace.getNodes().size());
assertNotNull(workspace.getNode(Fqn.fromString("/one/two")));
assertEquals(pojo2, workspace.getNode(Fqn.fromString("/one/two")).get("key1"));
assertTrue(entry.getLocks().isEmpty());