@Test public void testCreateBindingWhenConfigurationIsCreated() throws WCMException, PersistenceException { Assert.assertNotNull(context.resourceResolver().getResource("/conf/testing/settings/cloudconfigs")); ResourceChange change = new ResourceChange(ResourceChange.ChangeType.ADDED, "/conf/testing/settings/cloudconfigs/commerce", false); creator.onChange(ImmutableList.of(change)); Assert.assertNotNull(context.resourceResolver().getResource("/var/commerce/products/testing-english")); Resource config = context.resourceResolver().getResource("/conf/testing/settings/cloudconfigs/commerce/jcr:content"); Assert.assertEquals("/var/commerce/products/testing-english", config.getValueMap().get("cq:catalogPath")); }
@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);  }