From fb02c1039ac55c9bcf82507016e3938dc2426a21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 28 Jul 2019 16:08:29 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=85=20Add=20method=20to=20set=20debug=20fl?= =?utf8?q?ag?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/Core.java | 4 ++++ src/test/kotlin/net/pterodactylus/sone/core/CoreTest.kt | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index e0bd804..99527bc 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -235,6 +235,10 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, return debug.get(); } + public void setDebug() { + debug.set(true); + } + /** * Returns the options used by the core. * diff --git a/src/test/kotlin/net/pterodactylus/sone/core/CoreTest.kt b/src/test/kotlin/net/pterodactylus/sone/core/CoreTest.kt index d6c56d4..f595cc0 100644 --- a/src/test/kotlin/net/pterodactylus/sone/core/CoreTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/core/CoreTest.kt @@ -151,4 +151,20 @@ class CoreTest { assertThat(core.debug, equalTo(false)) } + @Test + fun `debug flag can be set`() { + val configuration = mock() + val freenetInterface = mock() + val identityManager = mock() + val soneDownloader = mock() + val imageInserter = mock() + val updateChecker = mock() + val webOfTrustUpdater = mock() + val eventBus = mock() + val database = mock() + val core = Core(configuration, freenetInterface, identityManager, soneDownloader, imageInserter, updateChecker, webOfTrustUpdater, eventBus, database) + core.setDebug() + assertThat(core.debug, equalTo(true)) + } + } -- 2.7.4