@Test public void assertEnableWithInvalidPath() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_app", null, "".getBytes()), new ChildData("/other/test_app", null, "".getBytes())); verify(jobConfigService, times(0)).loadAll(); verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); }
@Override public void event(final Type type, final ChildData oldData, final ChildData data) { String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); if (Type.NODE_CREATED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { disableApp(appName); } } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { enableApp(appName); } } }
CloudAppDisableListener implements CuratorCacheListener { @Override public void event(final Type type, final ChildData oldData, final ChildData data) { String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); if (Type.NODE_CREATED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { disableApp(appName); } } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { enableApp(appName); } } } }
CloudAppDisableListener implements CuratorCacheListener { @Override public void event(final Type type, final ChildData oldData, final ChildData data) { String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); if (Type.NODE_CREATED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { disableApp(appName); } } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { enableApp(appName); } } } CloudAppDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); }
CloudAppDisableListener implements CuratorCacheListener { @Override public void event(final Type type, final ChildData oldData, final ChildData data) { String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); if (Type.NODE_CREATED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { disableApp(appName); } } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { enableApp(appName); } } } CloudAppDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Override void event(final Type type, final ChildData oldData, final ChildData data); void start(); void stop(); }
CloudAppDisableListener implements CuratorCacheListener { @Override public void event(final Type type, final ChildData oldData, final ChildData data) { String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); if (Type.NODE_CREATED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { disableApp(appName); } } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { String appName = path.substring(DisableAppNode.ROOT.length() + 1); if (Objects.nonNull(appName)) { enableApp(appName); } } } CloudAppDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Override void event(final Type type, final ChildData oldData, final ChildData data); void start(); void stop();  }