ViewRegistry.init(viewDAO, viewInstanceDAO);
ViewRegistry registry = ViewRegistry.getInstance();
ViewInstanceEntity viewInstanceEntity = ViewInstanceEntityTest.getViewInstanceEntity();
viewInstanceEntity.putInstanceData("foo", "value");
ViewInstanceDataEntity dataEntity = viewInstanceEntity.getInstanceData("foo");
viewInstanceDAO.removeData(dataEntity);
expect(viewInstanceDAO.merge(viewInstanceEntity)).andReturn(viewInstanceEntity);
replay(viewDAO, viewInstanceDAO);
registry.removeInstanceData(viewInstanceEntity, "foo");
Assert.assertNull(viewInstanceEntity.getInstanceData("foo"));
verify(viewDAO, viewInstanceDAO);
}