Skip to content

Commit 5f46951

Browse files
committed
Update to Mockito 5. Remove PowerMockito.
1 parent 1fb1383 commit 5f46951

File tree

10 files changed

+931
-265
lines changed

10 files changed

+931
-265
lines changed

pom.xml

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@
4242
<properties>
4343
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4444
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
45-
<java.version>17</java.version>
46-
<powermock.version>2.0.9</powermock.version>
45+
<java.version>21</java.version>
46+
<junit.version>5.10.2</junit.version>
47+
<mockito.version>5.11.0</mockito.version>
4748
<!-- More visible way how to change dependency versions -->
48-
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
49-
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
49+
<paper.version>1.21.10-R0.1-SNAPSHOT</paper.version>
50+
<bentobox.version>3.10.0</bentobox.version>
5051
<!-- Revision variable removes warning about dynamic version -->
5152
<revision>${build.version}-SNAPSHOT</revision>
5253
<!-- This allows to change between versions and snapshots. -->
@@ -102,8 +103,12 @@
102103

103104
<repositories>
104105
<repository>
105-
<id>spigot-repo</id>
106-
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
106+
<id>jitpack.io</id>
107+
<url>https://jitpack.io</url>
108+
</repository>
109+
<repository>
110+
<id>papermc</id>
111+
<url>https://repo.papermc.io/repository/maven-public/</url>
107112
</repository>
108113
<repository>
109114
<id>bentoboxworld</id>
@@ -120,29 +125,42 @@
120125
</repositories>
121126

122127
<dependencies>
123-
<!-- Mockito (Unit testing) This goes at the top to ensure the dependencies are accurate. -->
124-
<!-- This is required for PowerMockito to work and must be placed before it -->
125128
<dependency>
126-
<groupId>org.javassist</groupId>
127-
<artifactId>javassist</artifactId>
128-
<version>3.30.2-GA</version>
129-
</dependency>
130-
<dependency>
131-
<groupId>org.powermock</groupId>
132-
<artifactId>powermock-module-junit4</artifactId>
133-
<version>${powermock.version}</version>
129+
<groupId>com.github.MockBukkit</groupId>
130+
<artifactId>MockBukkit</artifactId>
131+
<version>v1.21-SNAPSHOT</version>
134132
<scope>test</scope>
135-
</dependency>
133+
</dependency>
136134
<dependency>
137-
<groupId>org.powermock</groupId>
138-
<artifactId>powermock-api-mockito2</artifactId>
139-
<version>${powermock.version}</version>
140-
<scope>test</scope>
135+
<groupId>io.papermc.paper</groupId>
136+
<artifactId>paper-api</artifactId>
137+
<version>${paper.version}</version>
138+
<scope>provided</scope>
141139
</dependency>
140+
141+
<!-- Mockito (Unit testing) -->
142+
<dependency>
143+
<groupId>org.junit.jupiter</groupId>
144+
<artifactId>junit-jupiter-api</artifactId>
145+
<version>${junit.version}</version>
146+
<scope>test</scope>
147+
</dependency>
148+
<dependency>
149+
<groupId>org.junit.jupiter</groupId>
150+
<artifactId>junit-jupiter-engine</artifactId>
151+
<version>${junit.version}</version>
152+
<scope>test</scope>
153+
</dependency>
154+
<dependency>
155+
<groupId>org.mockito</groupId>
156+
<artifactId>mockito-junit-jupiter</artifactId>
157+
<version>5.11.0</version>
158+
<scope>test</scope>
159+
</dependency>
142160
<dependency>
143161
<groupId>org.mockito</groupId>
144162
<artifactId>mockito-core</artifactId>
145-
<version>3.11.1</version>
163+
<version>${mockito.version}</version>
146164
<scope>test</scope>
147165
</dependency>
148166
<dependency>
@@ -151,13 +169,6 @@
151169
<version>${bentobox.version}</version>
152170
<scope>provided</scope>
153171
</dependency>
154-
<!-- Spigot API -->
155-
<dependency>
156-
<groupId>org.spigotmc</groupId>
157-
<artifactId>spigot-api</artifactId>
158-
<version>${spigot.version}</version>
159-
<scope>provided</scope>
160-
</dependency>
161172
</dependencies>
162173

163174
<build>
@@ -191,20 +202,20 @@
191202
<plugin>
192203
<groupId>org.apache.maven.plugins</groupId>
193204
<artifactId>maven-clean-plugin</artifactId>
194-
<version>3.1.0</version>
205+
<version>3.5.0</version>
195206
</plugin>
196207
<plugin>
197208
<groupId>org.apache.maven.plugins</groupId>
198209
<artifactId>maven-compiler-plugin</artifactId>
199-
<version>3.7.0</version>
210+
<version>3.14.1</version>
200211
<configuration>
201212
<release>${java.version}</release>
202213
</configuration>
203214
</plugin>
204215
<plugin>
205216
<groupId>org.apache.maven.plugins</groupId>
206217
<artifactId>maven-surefire-plugin</artifactId>
207-
<version>3.0.0-M5</version>
218+
<version>3.5.4</version>
208219
<configuration>
209220
<argLine>
210221
${argLine}
@@ -241,12 +252,12 @@
241252
<plugin>
242253
<groupId>org.apache.maven.plugins</groupId>
243254
<artifactId>maven-jar-plugin</artifactId>
244-
<version>3.1.0</version>
255+
<version>3.5.0</version>
245256
</plugin>
246257
<plugin>
247258
<groupId>org.apache.maven.plugins</groupId>
248259
<artifactId>maven-source-plugin</artifactId>
249-
<version>3.0.1</version>
260+
<version>3.4.0</version>
250261
<executions>
251262
<execution>
252263
<id>attach-sources</id>
@@ -259,17 +270,17 @@
259270
<plugin>
260271
<groupId>org.apache.maven.plugins</groupId>
261272
<artifactId>maven-install-plugin</artifactId>
262-
<version>2.5.2</version>
273+
<version>3.1.4</version>
263274
</plugin>
264275
<plugin>
265276
<groupId>org.apache.maven.plugins</groupId>
266277
<artifactId>maven-deploy-plugin</artifactId>
267-
<version>2.8.2</version>
278+
<version>3.1.4</version>
268279
</plugin>
269280
<plugin>
270281
<groupId>org.jacoco</groupId>
271282
<artifactId>jacoco-maven-plugin</artifactId>
272-
<version>0.8.10</version>
283+
<version>0.8.14</version>
273284
<configuration>
274285
<append>true</append>
275286
<excludes>

0 commit comments

Comments
 (0)