Add more tests of sone inserter.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneInserter.java
index 729f434..1e93aa6 100644 (file)
@@ -116,12 +116,17 @@ public class SoneInserter extends AbstractService {
         *            The Sone to insert
         */
        public SoneInserter(Core core, EventBus eventBus, FreenetInterface freenetInterface, Sone sone) {
+               this(core, eventBus, freenetInterface, sone, new SoneModificationDetector(core, sone, insertionDelay));
+       }
+
+       @VisibleForTesting
+       SoneInserter(Core core, EventBus eventBus, FreenetInterface freenetInterface, Sone sone, SoneModificationDetector soneModificationDetector) {
                super("Sone Inserter for “" + sone.getName() + "”", false);
                this.core = core;
                this.eventBus = eventBus;
                this.freenetInterface = freenetInterface;
                this.sone = sone;
-               this.soneModificationDetector = new SoneModificationDetector(core, sone, insertionDelay);
+               this.soneModificationDetector = soneModificationDetector;
        }
 
        //