From 52c5e2dba792cb8ac2223e6a734ddab6bfc6a37c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 20 Jun 2020 20:21:56 -0700 Subject: [PATCH] Cleanup. --- .../net/thauvin/erik/mobibot/commands/Versions.java | 7 +++---- .../java/net/thauvin/erik/mobibot/PinboardUtilsTest.kt | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java b/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java index 7b80f3d..37491da 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Versions.java @@ -40,7 +40,7 @@ import org.jetbrains.annotations.NotNull; import java.util.List; public class Versions extends AbstractCommand { - private final List versions = + private final List verList = List.of("Version: " + ReleaseInfo.VERSION + " (" + Utils.isoLocalDate(ReleaseInfo.BUILDDATE) + ')', "Platform: " + System.getProperty("os.name") + " (" + System.getProperty("os.version") + ", " + System.getProperty("os.arch") + ", " + System.getProperty("user.country") + ')', @@ -64,8 +64,7 @@ public class Versions extends AbstractCommand { @NotNull @Override public List getHelp() { - return List.of("To view the versions data (bot, java, etc.):", - Utils.helpIndent("%s " + getName())); + return List.of("To view the versions data (bot, platform, java, etc.):", Utils.helpIndent("%c " + getName())); } @Override @@ -90,7 +89,7 @@ public class Versions extends AbstractCommand { final boolean isOp, final boolean isPrivate) { if (isOp) { - for (final String v : versions) { + for (final String v : verList) { getBot().send(sender, v, isPrivate); } } else { diff --git a/src/test/java/net/thauvin/erik/mobibot/PinboardUtilsTest.kt b/src/test/java/net/thauvin/erik/mobibot/PinboardUtilsTest.kt index b79ff3d..5f58c91 100644 --- a/src/test/java/net/thauvin/erik/mobibot/PinboardUtilsTest.kt +++ b/src/test/java/net/thauvin/erik/mobibot/PinboardUtilsTest.kt @@ -37,8 +37,6 @@ import net.thauvin.erik.pinboard.PinboardPoster import org.testng.Assert import org.testng.annotations.Test import java.net.URL -import java.net.URLEncoder -import java.nio.charset.StandardCharsets class PinboardUtilsTest : LocalProperties() { @Test @@ -61,8 +59,12 @@ class PinboardUtilsTest : LocalProperties() { } private fun validatePin(apiToken: String, ircServer: String = "", url: String): Boolean { - val response = Utils.urlReader(URL("https://api.pinboard.in/v1/posts/get?auth_token=${apiToken}&tag=test&" - + Utils.encodeUrl(url))) + val response = Utils.urlReader( + URL( + "https://api.pinboard.in/v1/posts/get?auth_token=${apiToken}&tag=test&" + + Utils.encodeUrl(url) + ) + ) return response.contains(url) && response.contains(ircServer) }