@Test
public void copyAllInstanceData() throws Exception {

  ViewEntity entity1 = getViewEntityMock(VERSION_1);
  ViewEntity entity2 = getViewEntityMock(VERSION_2);
  replay(entity1, entity2);
  ViewInstanceDataEntity dataEntity = new ViewInstanceDataEntity();
  dataEntity.setName("name1");
  dataEntity.setValue("value1");
  dataEntity.setUser("user1");
  Collection<ViewInstanceDataEntity> data1 = Arrays.asList(dataEntity);
  List<ViewInstanceDataEntity> data2 = new ArrayList<>();
  ViewInstanceEntity instanceEntity1 = getViewInstanceEntityMock(entity1);
  expect(instanceEntity1.getData()).andReturn(data1).anyTimes();
  ViewInstanceEntity instanceEntity2 = getViewInstanceEntityMock(entity2);
  expect(instanceEntity2.getData()).andReturn(data2).anyTimes();
  replay(instanceEntity1, instanceEntity2);
  ViewDataMigrationContextImpl context = new TestViewDataMigrationContextImpl(instanceEntity1, instanceEntity2);
  context.copyAllInstanceData();
  Assert.assertEquals(1, data2.size());
  Assert.assertEquals("user1", data2.get(0).getUser());
  Assert.assertEquals("name1", data2.get(0).getName());
  Assert.assertEquals("value1", data2.get(0).getValue());
}