@Test public void testCreateRespectsConfigKey() { TestEntity entity2 = app.createAndManageChild( TestEntity.Spec.newInstance().configure(TestEntity.CONF_NAME, "foo")); assertEquals(entity2.getConfig(TestEntity.CONF_NAME), "foo"); }
@Test public void testCreateRespectsFlagInMap() { TestEntity entity2 = app.createAndManageChild( TestEntity.Spec.newInstance().configure(MutableMap.of("confName", "baz"))); assertEquals(entity2.getConfig(TestEntity.CONF_NAME), "baz"); }
@Test public void testDisplayName() { TestEntity result = entity.createAndManageChild(TestEntity.Spec.newInstance().displayName("Boo")); assertIsProxy(result); assertEquals(result.getDisplayName(), "Boo"); }
@Test public void testCreateAndManageChild() { TestEntity result = entity.createAndManageChild(TestEntity.Spec.newInstance()); assertIsProxy(result); assertIsProxy(Iterables.get(entity.getChildren(), 0)); assertIsProxy(result.getParent()); assertIsProxy(managementContext.getEntityManager().getEntity(result.getId())); }
@BeforeMethod(alwaysRun = true) public void setUp() throws Exception { app = ApplicationBuilder.newManagedApp(TestApplication.class); entity = app.createAndManageChild(TestEntity.Spec.newInstance()); managementContext = app.getManagementContext(); }