GlobalExperimentalFeaturesStorageImpl extends AbstractScopedExperimentalFeaturesStorage { @Override public Collection<ExperimentalFeatureImpl> getFeatures() { return globalFeatures; } @Inject  GlobalExperimentalFeaturesStorageImpl(final SessionInfo sessionInfo, @Named("configIO") final IOService ioService, final ExperimentalFeatureDefRegistry defRegistry, final Event<PortableExperimentalFeatureModifiedEvent> event); @Override void init(FileSystem fileSystem); @Override Collection<ExperimentalFeatureImpl> getFeatures(); @Override String getStoragePath(); @Override ExperimentalStorageScope getScope(); static final String GLOBAL_STORAGE_PATH; }
@Test public void testStoreFeature() throws IOException { testRegularLoad(); storage.store(new ExperimentalFeatureImpl(FEATURE_1, true)); verify(ioService, never()).newOutputStream(any()); verify(ioService, never()).startBatch(fileSystem); verify(ioService, never()).endBatch(); verify(event, never()).fire(any()); storage.store(new ExperimentalFeatureImpl(GLOBAL_FEATURE_1, false)); verify(ioService).newOutputStream(any()); verify(ioService).startBatch(fileSystem); verify(ioService).endBatch(); verify(event).fire(any()); verifyLoadedFeatures(new ArrayList<>(storage.getFeatures()), new ExperimentalFeatureImpl(GLOBAL_FEATURE_1, false), new ExperimentalFeatureImpl(GLOBAL_FEATURE_2, false), new ExperimentalFeatureImpl(GLOBAL_FEATURE_3, true)); }