/** * Constructs a new {@code MockBackendFactory}. */ @VisibleForReflection public MockBackendFactory() { this(new InvalidBackend("You need to register the instance you want to use with BackendFactoryRegistry.register() first")); }
@BeforeEach void setUp() { invalidBackend = new InvalidBackend(""); }
/** * Creates a new {@link StoreAdapter} on top of a newly created transient {@link Backend}, using the default {@link * InMemoryBackendFactory} implementation. * * @return a new store */ @Nonnull private StoreAdapter createTransientStore() { Backend backend; ImmutableConfig config; if (factory.supportsTransient()) { config = new InMemoryConfig(); backend = new InMemoryBackendFactory().createBackend(uri, config); } else { config = new BaseConfig<>(); backend = new InvalidBackend("This back-end does not provide a transient layer: you must save/load the associated resource before using it"); } return createStore(backend, config); }