@Test
public void testGetCluster() throws Exception {

  InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
  ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
  ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);
  ViewRegistry viewRegistry = createNiceMock(ViewRegistry.class);
  Cluster cluster = createNiceMock(Cluster.class);
  expect(viewRegistry.getCluster(viewInstanceDefinition)).andReturn(cluster);
  replay(viewRegistry);
  ViewContextImpl viewContext = new ViewContextImpl(viewInstanceDefinition, viewRegistry);
  Assert.assertEquals(cluster, viewContext.getCluster());
  verify(viewRegistry);
}