@Test public void configurationWithoutRepositoryDoesNotGetUpdated() throws Exception { when(repositoryManager.browseForCleanupPolicy(any())).thenReturn(empty()); underTest.on(new OrientCleanupPolicyDeletedEvent(entityMetadata1)); when(repositoryManager.browseForCleanupPolicy(any())).thenReturn(empty()); underTest.on(new OrientCleanupPolicyDeletedEvent(entityMetadata2)); verifyConfigurationNeverUpdated(); }
@Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); @Subscribe @AllowConcurrentEvents void on(final CleanupPolicyDeletedEvent event); }
CleanupPolicyEventHandler extends ComponentSupport implements EventAware, Asynchronous { @Subscribe @AllowConcurrentEvents public void on(final CleanupPolicyDeletedEvent event) { if (shouldProcess(event)) { CleanupPolicy cleanupPolicy = event.getCleanupPolicy(); repositoryManager .browseForCleanupPolicy(cleanupPolicy.getName()) .forEach(repository -> remove(repository.getConfiguration().copy(), cleanupPolicy)); } } @Inject  CleanupPolicyEventHandler(final RepositoryManager repositoryManager); @Subscribe @AllowConcurrentEvents void on(final CleanupPolicyDeletedEvent event);  }