From aff23203958d9e42b86b627577e3342c33eca94a Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 6 Aug 2019 17:25:17 -0700 Subject: [PATCH] Update to latest Mockito and PowerMock and use build numbers https://github.com/BentoBoxWorld/BSkyBlock/issues/173 --- pom.xml | 183 ++++++++++++------ .../bentobox/bskyblock/BSkyBlockTest.java | 2 +- .../bskyblock/commands/AdminCommandTest.java | 2 +- .../bskyblock/commands/IslandCommandTest.java | 6 +- 4 files changed, 131 insertions(+), 62 deletions(-) diff --git a/pom.xml b/pom.xml index b7f84b7..bcd0a60 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,24 @@ world.bentobox bskyblock - 1.6.0-SNAPSHOT + ${revision} BSkyBlock BSkyBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. https://github.com/BentoBoxWorld/BSkyBlock 2017 + + + tastybento + tastybento@bentobox.world + -8 + + Lead Developer + + + + scm:git:https://github.com/BentoBoxWorld/BSkyBlock.git scm:git:git@github.com:BentoBoxWorld/BSkyBlock.git @@ -41,12 +52,59 @@ - UTF-8 - UTF-8 - 1.8 - 1.7.4 + UTF-8 + UTF-8 + 1.8 + + 2.0.2 + + 1.13.2-R0.1-SNAPSHOT + 1.6.0-SNAPSHOT + + ${build.version}-SNAPSHOT + + -LOCAL + + 1.6.0 + + + + + + ci + + + env.BUILD_NUMBER + + + + + -b${env.BUILD_NUMBER} + + + + + + + + master + + + env.GIT_BRANCH + origin/master + + + + + ${build.version} + + + + + + spigot-repo @@ -63,45 +121,51 @@ - - org.spigotmc - spigot-api - 1.14.1-R0.1-SNAPSHOT - provided - - - org.mockito - mockito-all - 2.0.2-beta - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - - - org.mongodb - mongodb-driver - 3.10.1 - + + + org.spigotmc + spigot-api + ${spigot.version} + provided + + + + org.mockito + mockito-core + 3.0.0 + test + + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + world.bentobox bentobox - 1.6.0-SNAPSHOT + ${bentobox.version} provided + + + + + + + ${project.name}-${revision}${build.number} + clean package + src/main/resources @@ -201,28 +265,33 @@ maven-deploy-plugin 2.8.2 - - org.jacoco - jacoco-maven-plugin - 0.8.1 - - true - - - - pre-unit-test - - prepare-agent - - - - post-unit-test - - report - - - - + + org.jacoco + jacoco-maven-plugin + 0.8.3 + + true + + + **/*Names* + + + + + pre-unit-test + + prepare-agent + + + + post-unit-test + + report + + + + diff --git a/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java b/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java index a70bcaa..d782f21 100644 --- a/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java +++ b/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java @@ -98,7 +98,7 @@ public class BSkyBlockTest { // Locales // Return the reference (USE THIS IN THE FUTURE) - when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgumentAt(0, String.class)); + when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); // Server PowerMockito.mockStatic(Bukkit.class); diff --git a/src/test/java/world/bentobox/bskyblock/commands/AdminCommandTest.java b/src/test/java/world/bentobox/bskyblock/commands/AdminCommandTest.java index f916635..223f26c 100644 --- a/src/test/java/world/bentobox/bskyblock/commands/AdminCommandTest.java +++ b/src/test/java/world/bentobox/bskyblock/commands/AdminCommandTest.java @@ -68,7 +68,7 @@ public class AdminCommandTest { // Locales // Return the reference (USE THIS IN THE FUTURE) - when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgumentAt(0, String.class)); + when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); addon = mock(BSkyBlock.class); Settings settings = mock(Settings.class); diff --git a/src/test/java/world/bentobox/bskyblock/commands/IslandCommandTest.java b/src/test/java/world/bentobox/bskyblock/commands/IslandCommandTest.java index 89490d2..b18287d 100644 --- a/src/test/java/world/bentobox/bskyblock/commands/IslandCommandTest.java +++ b/src/test/java/world/bentobox/bskyblock/commands/IslandCommandTest.java @@ -6,8 +6,8 @@ package world.bentobox.bskyblock.commands; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -95,7 +95,7 @@ public class IslandCommandTest { // Locales // Return the reference (USE THIS IN THE FUTURE) - when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgumentAt(0, String.class)); + when(user.getTranslation(Mockito.anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); addon = mock(BSkyBlock.class); Settings settings = mock(Settings.class);