From 904522367dca6705906b88af5e8930adeea2034e Mon Sep 17 00:00:00 2001 From: tastybento Date: Wed, 7 Aug 2019 08:08:11 -0700 Subject: [PATCH] Updates POM to show build numbers in final name https://github.com/BentoBoxWorld/Level/issues/74 Also updates to latest PowerMockito and Mockito2 --- pom.xml | 142 +++++++++++++----- .../bentobox/level/LevelPresenterTest.java | 6 +- .../java/world/bentobox/level/TopTenTest.java | 2 +- 3 files changed, 108 insertions(+), 42 deletions(-) diff --git a/pom.xml b/pom.xml index d92b547..88003e2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,24 @@ world.bentobox level - 1.6.0-SNAPSHOT + ${revision} Level Level is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. https://github.com/BentoBoxWorld/Level 2017 + + + tastybento + tastybento@bentobox.world + -8 + + Lead Developer + + + + scm:git:https://github.com/BentoBoxWorld/Level.git scm:git:git@github.com:BentoBoxWorld/Level.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 @@ -62,40 +120,50 @@ - - - org.spigotmc - spigot-api - 1.13.2-R0.1-SNAPSHOT - provided - - - org.mockito - mockito-all - 1.10.19 - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - - - world.bentobox - bentobox - 1.6.0-SNAPSHOT - provided - - + + + + 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 + ${bentobox.version} + provided + + + + + + + + + ${project.name}-${revision}${build.number} + clean package diff --git a/src/test/java/world/bentobox/level/LevelPresenterTest.java b/src/test/java/world/bentobox/level/LevelPresenterTest.java index 51293e5..e701c72 100644 --- a/src/test/java/world/bentobox/level/LevelPresenterTest.java +++ b/src/test/java/world/bentobox/level/LevelPresenterTest.java @@ -48,7 +48,7 @@ public class LevelPresenterTest { when(im.inTeam(Mockito.any(), Mockito.any())).thenReturn(true); // team leader when(im.getOwner(Mockito.any(), Mockito.any())).thenReturn(UUID.randomUUID()); - + pl = mock(PlayerLevel.class); PowerMockito.whenNew(PlayerLevel.class).withAnyArguments().thenReturn(pl); @@ -72,10 +72,8 @@ public class LevelPresenterTest { User sender = mock(User.class); UUID targetPlayer = UUID.randomUUID(); lp.calculateIslandLevel(world, sender, targetPlayer); - + Mockito.verify(sender).sendMessage("island.level.calculating"); - // Verify PlayerLevel was called - Mockito.verify(pl); } } diff --git a/src/test/java/world/bentobox/level/TopTenTest.java b/src/test/java/world/bentobox/level/TopTenTest.java index d242e0e..47cee5c 100644 --- a/src/test/java/world/bentobox/level/TopTenTest.java +++ b/src/test/java/world/bentobox/level/TopTenTest.java @@ -116,7 +116,7 @@ public class TopTenTest { when(plugin.getIWM()).thenReturn(iwm); // User - when(user.getTranslation(anyString())).thenAnswer((Answer) invocation -> invocation.getArgumentAt(0, String.class)); + when(user.getTranslation(anyString())).thenAnswer((Answer) invocation -> invocation.getArgument(0, String.class)); when(user.getTranslation(eq("island.top.gui-heading"), eq("[name]"), anyString(), eq("[rank]"), anyString())).thenReturn("gui-heading"); when(user.getTranslation(eq("island.top.island-level"),eq("[level]"), anyString())).thenReturn("island-level"); when(user.getPlayer()).thenReturn(player);