Github user nakomis commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/540#discussion_r25849995
  
    --- Diff: 
core/src/test/java/brooklyn/entity/rebind/RebindCatalogItemTest.java ---
    @@ -192,6 +194,23 @@ public void 
testSameCatalogItemIdRemovalAndAdditionRebinds() throws Exception {
             rebindAndAssertCatalogsAreEqual();
         }
     
    +    @Test
    +    public void testRebindAfterItemDeprecated() {
    +        String yaml =
    +                "name: rebind-yaml-catalog-item-test\n" +
    +                "brooklyn.catalog:\n" +
    +                "  version: " + TEST_VERSION + "\n" +
    +                "services:\n" +
    +                "- type: io.camp.mock:AppServer";
    +        BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) 
origManagementContext.getCatalog();
    +        CatalogItem<?, ?> catalogItem = catalog.addItem(yaml);
    +        assertNotNull(catalogItem, "catalogItem");
    +        catalogItem.setDeprecated(true);
    --- End diff --
    
    It was passing because after rebinding I was getting 
`catalogItemAfterRebind` from `catalog`. I've changed it to `CatalogItem<?, ?> 
catalogItemAfterRebind = 
newManagementContext.getCatalog().getCatalogItem("rebind-yaml-catalog-item-test",
 TEST_VERSION);` and it's failing without the catalog.persist(catalogItem)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to