Add JUnit 5 test suite and migrate to Paper API 1.21.11#49
Merged
Conversation
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add JUnit 5 test classes for the project
Add JUnit 5 test suite and migrate to Paper API 1.21.11
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No tests existed for the Chat addon, making refactoring and validation impossible. This PR introduces a full JUnit 5 test suite using MockBukkit and migrates the project to Paper API 1.21.11.
pom.xmlspigot-apiwithpaper-api:1.21.11-R0.1-SNAPSHOT2.7.1-SNAPSHOT→3.10.2v1.21-SNAPSHOT,mockito-junit-jupiter3.11.2→5.11.0maven-surefire-plugin:3.0.0-M5→3.5.2papermcandcodemc-snapshotsrepositoriesTest infrastructure
WhiteBox— reflection utility to set private/static fields (replaces PowerMock'sWhitebox)CommonTestSetup— abstract base with@BeforeEach/@AfterEachwiring up MockBukkit server, staticBukkitmock, BentoBox plugin/island/player mocks, locales, and full teardown includingMockBukkit.unmock()andUser.clearUsers()Test classes
SettingsTestEventPrioritystring parsing including invalid inputChatPladdonTestChatListenerTesttogglePlayerTeamChat,toggleSpy,toggleIslandSpy,toggleIslandChat,isChat,onChatrouting (team/island/unregistered world),teamChat/islandChatlog control,onLeave/onKickcleanupIslandTeamChatCommandTestsetup(),canExecute(team membership gate),executetoggle + inline sendIslandChatCommandTestsetup(),canExecute(island presence gate),executetoggle + inline sendAdminIslandChatSpyCommandTestsetup(), spy toggle on/offAdminTeamChatSpyCommandTestsetup(), spy toggle on/offIsTeamChatHandlerTestWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
hub.spigotmc.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Chat/Chat org.codehaus.plexus.classworlds.launcher.Launcher dependency:resolve -q(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Chat/Chat org.codehaus.plexus.classworlds.launcher.Launcher dependency:list -q(dns block)/usr/bin/curl curl -s --max-time 5 REDACTED(dns block)repo.codemc.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Chat/Chat org.codehaus.plexus.classworlds.launcher.Launcher dependency:resolve -q(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Chat/Chat org.codehaus.plexus.classworlds.launcher.Launcher dependency:list -q(dns block)/usr/bin/curl curl -s --max-time 5 REDACTED(dns block)repo.papermc.io/usr/bin/curl curl -sv --max-time 10 REDACTED(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.13/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.13/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.13 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.13/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Chat/Chat org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.