import net.pterodactylus.sone.database.PostDatabase;
import net.pterodactylus.sone.database.PostReplyBuilder;
import net.pterodactylus.sone.database.SoneBuilder;
-import net.pterodactylus.sone.database.SoneProvider;
import net.pterodactylus.util.config.Configuration;
import net.pterodactylus.util.config.ConfigurationException;
/** The lock. */
private final ReadWriteLock lock = new ReentrantReadWriteLock();
- /** The Sone provider. */
- private final SoneProvider soneProvider;
-
/** The configuration. */
private final Configuration configuration;
private final ConfigurationLoader configurationLoader;
/**
* Creates a new memory database.
*
- * @param soneProvider
- * The Sone provider
* @param configuration
* The configuration for loading and saving elements
*/
@Inject
- public MemoryDatabase(SoneProvider soneProvider, Configuration configuration) {
- this.soneProvider = soneProvider;
+ public MemoryDatabase(Configuration configuration) {
this.configuration = configuration;
this.configurationLoader = new ConfigurationLoader(configuration);
memoryBookmarkDatabase =
/** {@inheritDocs} */
@Override
public PostBuilder newPostBuilder() {
- return new MemoryPostBuilder(this, soneProvider);
+ return new MemoryPostBuilder(this, this);
}
//
/** {@inheritDocs} */
@Override
public PostReplyBuilder newPostReplyBuilder() {
- return new MemoryPostReplyBuilder(this, soneProvider);
+ return new MemoryPostReplyBuilder(this, this);
}
//
private static final String SONE_ID = "sone";
private static final String RECIPIENT_ID = "recipient";
private final Configuration configuration = mock(Configuration.class);
- private final MemoryDatabase memoryDatabase = new MemoryDatabase(null, configuration);
+ private final MemoryDatabase memoryDatabase = new MemoryDatabase(configuration);
private final Sone sone = mock(Sone.class);
@Before