@Test public void testDeleteBindingWhenConfigurationIsDeleted() { ResourceChange change = new ResourceChange(ResourceChange.ChangeType.REMOVED, "/conf/testing-to-be-deleted/settings/cloudconfigs/commerce", false); creator.onChange(ImmutableList.of(change)); Assert.assertNull(context.resourceResolver().getResource("/var/commerce/products/testing-to-be-deleted")); }
@Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); }
ProductBindingCreator implements ResourceChangeListener { @Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); } }
ProductBindingCreator implements ResourceChangeListener { @Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); }  }
ProductBindingCreator implements ResourceChangeListener { @Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); }  @Override void onChange(List<ResourceChange> list); }
ProductBindingCreator implements ResourceChangeListener { @Override public void onChange(List<ResourceChange> list) { LOG.debug("Change detected somewhere..."); list.stream().filter(change -> { String path = change.getPath(); LOG.debug("Processing path {}", path); return !path.endsWith(JcrConstants.JCR_CONTENT) && path.contains(Constants.COMMERCE_BUCKET_PATH); }).forEach(change -> { if (change.getType() == ResourceChange.ChangeType.ADDED) { processAddition(change); } if (change.getType() == ResourceChange.ChangeType.REMOVED) { processDeletion(change); } }); }  @Override void onChange(List<ResourceChange> list);  }