@Override protected void maybeNotifyFeatureUpdate(ExperimentalFeatureImpl feature) { event.fire(new PortableExperimentalFeatureModifiedEvent(feature)); } }
@Override protected void maybeNotifyFeatureUpdate(ExperimentalFeatureImpl feature) { event.fire(new PortableExperimentalFeatureModifiedEvent(feature)); } }
@Test public void testWrongNotifyFeatureUpdateViaEvent() { initService(true); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, true); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); feature = new ExperimentalFeatureImpl(WRONG_FEATURE_ID, true); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); }
@Test public void testWrongNotifyFeatureUpdateViaEvent() { initService(true); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, true); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); feature = new ExperimentalFeatureImpl(WRONG_FEATURE_ID, true); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); }
@Test public void testNotifyFeatureUpdateWhenExperimentalDisabledViaEvent() { initService(false); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, false); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); }
@Test public void testNotifyFeatureUpdateWhenExperimentalDisabledViaEvent() { initService(false); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, false); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); verify(event, never()).fire(any()); }
@Test public void testOnFeatureModifiedGlobalEvent() { testOnFeatureModified(feature -> authorizationManager.onFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature))); }
@Test public void testOnFeatureModifiedGlobalEvent() { testOnFeatureModified(feature -> authorizationManager.onFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature))); }
@Test public void testNotifyFeatureUpdateViaEvent() { initService(true); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, false); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); checkNotifyFeatureUpdate(feature); }
@Test public void testNotifyFeatureUpdateViaEvent() { initService(true); ExperimentalFeatureImpl feature = new ExperimentalFeatureImpl(FEATURE_1, false); service.onGlobalFeatureModified(new PortableExperimentalFeatureModifiedEvent(feature)); checkNotifyFeatureUpdate(feature); }