@Test public void shouldNotCallListenersForOtherTenants() throws Exception { listener.registerListener("otherTenantId", change); listener.onEvent(changeExecutedEvent); verify(change, never()).onExecution(MIGRATION); }
@Override protected void onEvent(ChangeExecutedEvent event) { if (!hasListenersForTenant(event.getTenantId())) { return; } try { for (Change change : getListenersForTenant(event.getTenantId())) { if (change.equals(event.getChange())) { change.onExecution(event.getMigration()); } } } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { throw new RuntimeException(e); } }
ChangeExecutedEventListener extends EventDistributor<ChangeExecutedEvent, Change> { @Override protected void onEvent(ChangeExecutedEvent event) { if (!hasListenersForTenant(event.getTenantId())) { return; } try { for (Change change : getListenersForTenant(event.getTenantId())) { if (change.equals(event.getChange())) { change.onExecution(event.getMigration()); } } } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { throw new RuntimeException(e); } } }
ChangeExecutedEventListener extends EventDistributor<ChangeExecutedEvent, Change> { @Override protected void onEvent(ChangeExecutedEvent event) { if (!hasListenersForTenant(event.getTenantId())) { return; } try { for (Change change : getListenersForTenant(event.getTenantId())) { if (change.equals(event.getChange())) { change.onExecution(event.getMigration()); } } } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { throw new RuntimeException(e); } } @Autowired  ChangeExecutedEventListener(ClusterService clusterService,
                                       TenantService tenantService,
                                       ApplicationContext applicationContext); }
ChangeExecutedEventListener extends EventDistributor<ChangeExecutedEvent, Change> { @Override protected void onEvent(ChangeExecutedEvent event) { if (!hasListenersForTenant(event.getTenantId())) { return; } try { for (Change change : getListenersForTenant(event.getTenantId())) { if (change.equals(event.getChange())) { change.onExecution(event.getMigration()); } } } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { throw new RuntimeException(e); } } @Autowired  ChangeExecutedEventListener(ClusterService clusterService,
                                       TenantService tenantService,
                                       ApplicationContext applicationContext);  }
ChangeExecutedEventListener extends EventDistributor<ChangeExecutedEvent, Change> { @Override protected void onEvent(ChangeExecutedEvent event) { if (!hasListenersForTenant(event.getTenantId())) { return; } try { for (Change change : getListenersForTenant(event.getTenantId())) { if (change.equals(event.getChange())) { change.onExecution(event.getMigration()); } } } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { throw new RuntimeException(e); } } @Autowired  ChangeExecutedEventListener(ClusterService clusterService,
                                       TenantService tenantService,
                                       ApplicationContext applicationContext);   }