Testing modules and plugins
As of v7.1.0, com.ultikits:ultitools-testkit offers two optional ways to test without a Minecraft client. Use MockBukkit to exercise your code with the real framework in the test JVM. Use headless Paper to check what the packaged JAR registers on a server. Neither layer shows what a player sees in a real client. The kit is experimental, with no promised date for stabilization. You can use other tools or omit it entirely.
| Capability | UltiTools module | Ordinary JavaPlugin |
|---|---|---|
| In-process startup and annotated commands | List module entry classes in value | List plugin entry classes in externalPlugins; the plugin connects itself |
| Inject a bean into a test field | Yes, from a listed module | No, the extension searches module containers only |
| Compare rendered chat and advance ticks | Yes | Yes, with the connected plugin’s own catalogue |
| Replace a bean before injection | Yes, for one listed module | No, BeanOverrides.replace targets an UltiToolsPlugin class |
| Override startup configuration | Yes, for one listed module | No, ConfigOverride.module selects an UltiToolsPlugin, not a plugin data folder |
| Exercise SQLite storage | module.getDataOperator(…) | UltiToolsAPI.getDataOperator(plugin, …) after connection |
| Check a packaged JAR and install dependencies on Paper | MODULE (default) | EXTERNAL_PLUGIN |
Dependencies
Use JDK 25. Pin the framework and kit separately. Kit X.Y.n supports framework versions on the same X.Y line starting at X.Y.0. If there is no kit with the framework’s patch number, choose the latest available kit on that line. The kit declares the framework as provided; it does not choose the application’s runtime version.
<properties>
<maven.compiler.release>25</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<ultitools.version>7.1.0</ultitools.version>
<ultitools.testkit.version>7.1.0</ultitools.testkit.version>
</properties>
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.ultikits</groupId>
<artifactId>UltiTools-API</artifactId>
<version>${ultitools.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>26.3.build.258-stable</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ultikits</groupId>
<artifactId>ultitools-testkit</artifactId>
<version>${ultitools.testkit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>6.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>6.1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.16.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
</plugins>
</build>Merge these entries into your existing POM. Pin the compiler and Surefire versions rather than relying on Maven defaults: older Surefire versions, such as 2.12.4, do not run Jupiter tests. With failIfNoTests, the build fails if no tests run.
The framework and test kit are available from Maven Central. Declare Paper API yourself: it is not transitive from the kit. In Gradle put the same Paper API coordinate on both compileOnly and testImplementation. In Maven declare the kit before any direct MockBukkit dependency so its registry mapping takes precedence, or remove the direct dependency. Without Paper, a test taking a ServerMock parameter may fail to compile, or Jupiter may report NoClassDefFoundError: org/bukkit/Server during discovery before the extension can report ULTI-TEST-INPROC-018. The dependency fix is the same.
Use CLI 3.1.0 or later with the 7.1 templates to generate tests for either project kind. For an external plugin, run ultikits create my-plugin --template external-plugin. At the UltiTools-API version: prompt, press Enter to accept the default, 7.1.0; entering 7.0.0 generates the 7.0 template. CLI 3.0.0 generates the 7.0 module template without these tests. For a working module with production commands and resources, see the framework’s demo module.
In-process module tests
Put production classes and their resources, including the root plugin.yml, in the same class directory (normally target/classes). The standard Gradle layout puts resources in a separate output root; that layout does not provide the resources where the kit looks. Test classes can share the module’s Java package and remain in target/test-classes. Run Jupiter tests with mvn test.
package org.example.welcome;
import com.ultikits.ultitools.annotations.Autowired;
import com.ultikits.ultitools.testkit.UltiToolsTest;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.junit.jupiter.api.Test;
import org.mockbukkit.mockbukkit.ServerMock;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@UltiToolsTest(WelcomeModule.class)
class WelcomeCommandTest {
@Autowired
private GreetingService greetings;
@Test
void dispatchesTheModuleCommandAndChecksItsReply(ServerMock server) {
assertEquals("Hello, traveler!", greetings.greeting());
var player = server.addPlayer("Alex");
while (player.nextComponentMessage() != null) {
// Discard messages sent before the command.
}
assertTrue(player.performCommand("demowelcome greet"));
var reply = player.nextComponentMessage();
assertNotNull(reply);
assertEquals("Hello, traveler!", PlainTextComponentSerializer.plainText().serialize(reply));
}
}Each annotated class gets one MockBukkit server and its own temporary root. Let the extension start and stop it. It attempts to remove temporary files at shutdown; deletion is not guaranteed. Request ServerMock in a test or lifecycle method, not the constructor. List modules in dependency order. If a required module is available only as a dependency JAR, use the real-server layer with alsoInstall instead.
Do not register modules during the test or dispatch commands from module startup. MockBukkit fires Paper’s command registration event only once, on the first dispatch. A bootstrap hook can run, but a module declaring bootstrap content needs real Paper; its in-process test class aborts.
In-process external plugin tests
Keep the plugin’s ordinary non-final JavaPlugin entry class with a public no-argument constructor. Put the test in the test source tree. This example uses the entry class's package to access package-private members; the kit does not require this. Place a matching plugin.yml with depend: [UltiTools] beside the compiled classes, or use paper-plugin.yml with a required UltiTools server dependency, load: BEFORE and classpath access. Gradle's default layout puts resources in a separate directory. Configure the build to put the descriptor and messages/ in the same output directory as the compiled classes. The kit enables UltiTools, then the listed modules, then the external plugins. Your plugin calls UltiToolsAPI.connect(this) in onEnable() and UltiToolsAPI.disconnect(this) in onDisable().
The kit does not expose the external plugin's beans. Here the service gives the plugin a reference to itself during construction; the test reads it after enable. The test also needs a command that handles /welcomeguide hello and replies with Hello from WelcomePlugin!.
package example.guide.welcome;
import com.ultikits.ultitools.api.UltiToolsAPI;
import org.bukkit.plugin.java.JavaPlugin;
public class WelcomePlugin extends JavaPlugin {
private WelcomeService welcomeService;
public WelcomePlugin() {}
@Override
public void onEnable() {
UltiToolsAPI.connect(this);
}
@Override
public void onDisable() {
UltiToolsAPI.disconnect(this);
}
void setWelcomeService(WelcomeService welcomeService) {
this.welcomeService = welcomeService;
}
WelcomeService welcomeService() {
return welcomeService;
}
}package example.guide.welcome;
import com.ultikits.ultitools.annotations.Autowired;
import com.ultikits.ultitools.annotations.Service;
import com.ultikits.ultitools.text.Messages;
import org.bukkit.plugin.java.JavaPlugin;
@Service
public class WelcomeService {
final JavaPlugin owner;
final WelcomePlugin main;
@Autowired
Messages messages;
// ...
public WelcomeService(JavaPlugin owner, WelcomePlugin main) {
this.owner = owner;
this.main = main;
main.setWelcomeService(this);
}
// ...
}package example.guide.welcome;
import com.ultikits.ultitools.testkit.UltiToolsTest;
import net.kyori.adventure.text.Component;
import org.bukkit.plugin.java.JavaPlugin;
import org.junit.jupiter.api.Test;
import org.mockbukkit.mockbukkit.ServerMock;
import static com.ultikits.ultitools.testkit.UltiToolsTestAssertions.assertExternalPluginConnected;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertThrows;
@UltiToolsTest(externalPlugins = WelcomePlugin.class)
class WelcomeCommandTest {
@Test
void connectedPluginRunsItsAnnotatedCommand(ServerMock server) {
var plugin = (WelcomePlugin) server.getPluginManager().getPlugin("WelcomePlugin");
assertExternalPluginConnected(plugin);
var player = server.addPlayer();
assertTrue(player.performCommand("welcomeguide hello"));
assertEquals(Component.text("Hello from WelcomePlugin!"), player.nextComponentMessage());
}
@Test
void injectsTheSamePluginAsJavaPluginAndAsTheMainClass(ServerMock server) {
var plugin = (WelcomePlugin) server.getPluginManager().getPlugin("WelcomePlugin");
assertExternalPluginConnected(plugin);
var service = plugin.welcomeService();
assertNotNull(service);
assertSame(plugin, service.owner);
assertSame(plugin, service.main);
assertThrows(IllegalArgumentException.class, () -> JavaPlugin.getPlugin(WelcomePlugin.class));
}
}The connection assertion checks the plugin instance; dispatching its own command separately checks its registration and reply. A test field cannot inject an external plugin’s beans. A component in the plugin can receive JavaPlugin or the plugin’s own main class by constructor injection. For bundled messages and the package boundary for @Table discovery, see the external plugin API.
Messages and scheduled work
MessageAssertions compares the next captured chat component, including styles, with the expected message rendered for the same player, locale and arguments. It checks the result, not which key the sender used. A test listing one module can inject Messages. With several modules, each supplies its own Messages and a test field of that type fails with ULTI-TEST-INPROC-006. Inject a concrete service from the target module instead and read its Messages. For an external plugin, inject Messages into a scanned service and expose that service through the plugin, as WelcomeService does above. After enable, pass its Messages to MessageAssertions.forExternalPlugin. If catalogue fallback still renders the bare namespaced key, ULTI-TEST-INPROC-014 fails the assertion without consuming the inbox entry.
The module test injects Messages, clears the player's earlier messages and runs demowelcome greet before this assertion. assertMessage checks only the next message.
// ...
new MessageAssertions(messages).assertMessage(player, messages.key("welcome.greeting"),
Arg.string("greeting", "Hello, traveler!"));
// ...// ...
var plugin = (WelcomePlugin) server.getPluginManager().getPlugin("WelcomePlugin");
assertExternalPluginConnected(plugin);
var messages = plugin.welcomeService().messages;
var key = messages.key("welcome.greeting");
var player = server.addPlayer();
player.setLocale(Locale.ENGLISH);
assertEquals(Component.text("Welcome from the bundled catalogue!", NamedTextColor.GREEN),
messages.render(key, Locale.ENGLISH));
assertTrue(player.performCommand("welcomeguide greet"));
MessageAssertions.forExternalPlugin(plugin, messages).assertMessage(player, key);
// ...The external plugin's /welcomeguide greet subcommand sends welcome.greeting from its messages/en.yml catalogue.
In the next module test, heartbeat is an injected WelcomeHeartbeat service. Its markReady method has @Scheduled(delay = 2) and increments the count returned by runs(). This is the only test method in its class.
// ...
var time = new TestTime(server);
var schedule = WelcomeHeartbeat.class.getMethod("markReady").getAnnotation(Scheduled.class);
time.advanceTicksFor(1, schedule);
assertEquals(0, heartbeat.runs());
time.advanceTicksFor(1, schedule);
assertEquals(1, heartbeat.runs());
// ...For either project kind, TestTime.advanceTicks advances the mock scheduler on the server thread; advance(Duration) accepts nonnegative whole multiples of 50 ms. Neither sets the system clock. For synchronous annotated work use advanceTicksFor; for tick-triggered async work use advanceTicksAndAwait with the annotation and a fresh completion signal. For config-bound async work include one tick after the trigger so MockBukkit dispatches the body. Signal after the work, not before it. Waiting does not advance extra ticks. The annotation-aware helpers reject literal async schedules with ULTI-TEST-INPROC-013 before advancing. The raw helpers cannot validate the schedule or establish Paper’s wall-clock cadence.
Ticks and the phase of registered tasks carry over between methods of a test class. Measure new tasks relative to their registration tick. To check the exact boundary of a startup task, use a separate test class with one method.
Module bean replacements
package org.example.welcome;
import com.ultikits.ultitools.testkit.UltiToolsTest;
import com.ultikits.ultitools.testkit.beans.BeanOverrides;
import com.ultikits.ultitools.testkit.beans.ConfigureTestBeans;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.junit.jupiter.api.Test;
import org.mockbukkit.mockbukkit.ServerMock;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@UltiToolsTest(WelcomeModule.class)
class GreetingReplacementTest {
@ConfigureTestBeans
static void replaceGreetingService(BeanOverrides beans) {
beans.replace(WelcomeModule.class, GreetingService.class, () -> "Hello from the stand-in!");
}
@Test
void theProductionCommandUsesTheReplacement(ServerMock server) {
var player = server.addPlayer("Alex");
while (player.nextComponentMessage() != null) {
// Discard messages sent before the command.
}
assertTrue(player.performCommand("demowelcome greet"));
var reply = player.nextComponentMessage();
assertNotNull(reply);
assertEquals("Hello from the stand-in!", PlainTextComponentSerializer.plainText().serialize(reply));
}
}Declare a static @ConfigureTestBeans callback on the annotated test class. It runs once before normal module injection. Use BeanOverrides only in the callback; nested tests share the existing setup. The stand-in belongs to the test: no injection, proxying, lifecycle calls, command registration, listeners or scheduled tasks are applied to it. Other modules keep their own bindings. The hook selects a listed module, not an external plugin or a real server.
Replace one uniquely matching component or bean factory. Types already bound by the framework or configuration, such as config entities and UiService, cannot be replaced. Use @ConfigOverride for config entities. If the original implements several types, replacing one type also displaces the original for the others; do not rely on bindings that the replacement does not implement. The key is a raw Class: two beans differing only in generic arguments cannot be selected separately. Errors ULTI-TEST-INPROC-019 through 022 distinguish missing or ambiguous definitions, duplicate requests, invalid stand-ins and unlisted modules.
Module configuration overrides
package org.example.welcome;
import com.ultikits.ultitools.annotations.Autowired;
import com.ultikits.ultitools.testkit.UltiToolsTest;
import com.ultikits.ultitools.testkit.config.ConfigOverride;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@UltiToolsTest(value = WelcomeModule.class, config = {
@ConfigOverride(module = WelcomeModule.class, file = "config/welcome.yml",
key = "salutation", value = "'Hello, friend'"),
@ConfigOverride(module = WelcomeModule.class, entity = WelcomeSettings.class,
key = "recipient", value = "Casey")
})
class WelcomeConfigTest {
@Autowired
private WelcomeModule module;
@Test
void bindsTheQuotedYamlStringIncludingItsComma() {
assertEquals("Hello, friend", module.getConfig(WelcomeSettings.class).salutation());
}
@Test
void overridesASettingWhoseDefaultIsOnlyInJava() {
assertEquals("Casey", module.getConfig(WelcomeSettings.class).recipient());
}
}file selects an existing key in bundled YAML; entity selects a declared @ConfigEntry, including a default supplied only by a Java field. The latter checks the field type and writes to the path in @ConfigEntity, not a different path chosen during manual registration. Supply one YAML flow value. An unquoted comma can separate values, and braces can denote a map. To keep the comma as text, include the YAML quotes inside the Java string, as in "'Hello, friend'" above. Also quote strings that look like numbers or booleans, or contain [, ], #, or a colon followed by a space. For example, "'Use #1'" preserves the hash and "'true'" reads as a string.
The kit stages new YAML for the listed module before loading it, so startup conditions see the override. It does not overwrite bundled defaults, existing configuration files, external plugin configuration or real-server settings, and does not change the earlier bootstrap hook. Reading bundled defaults can clean up matching stale temporary files and eligible framework backups beside the resource; keep independent copies outside the compiled resource directory. Errors ULTI-TEST-INPROC-015 to 017 cover the key or target, the value, and file preparation respectively.
SQLite data
// ...
var entries = module.getDataOperator(WelcomeEntry.class);
assertTrue(entries.getAll().isEmpty());
entries.insert(new WelcomeEntry("first-greeting", "Casey"));
var stored = entries.getById("first-greeting");
assertNotNull(stored);
assertEquals("Casey", stored.getRecipient());
// ...A module’s public getDataOperator uses a real SQLite file in the temporary server root, separate for each module. A connected external plugin uses UltiToolsAPI.getDataOperator with the same plugin instance and an entity it owns. A packaged module is scanned for @Table entities across the entire JAR. In v7.0.0 the framework does not scan a class directory for entities. As of v7.1.0, a module loaded from a class directory discovers entities only in its component scan packages, selected by scanBasePackages or other scan settings. The default is the main class's package and subpackages. For an unregistered @Table entity with no known owner in the main class's output directory but outside all scanned packages and their subpackages, ULTI-3010 lists the scan packages and says that a module JAR is scanned in full. Move your entity under one of the listed packages or add it to @UltiToolsModule(additionalEntities = {MyEntity.class}), keeping existing entries. If the entity is in a different output directory, such as target/test-classes, and has no known owner, the refusal recommends the owning module's exposed service or the EventBus, without package advice. Test methods in one class share data; use distinct records or clear them through the API. Another annotated class starts empty. This tests SQLite, not MySQL or JSON storage.
Differences from a real server
As of v7.1.0, @UltiToolsTest loads compiled classes on MockBukkit. Some code that runs on Paper is rejected in process; other code runs with different timing or without a server feature it needs.
Stricter checks
- Module JARs (modules): the in-process loader accepts only class directories, even for dependency modules. Supply compiled module classes or test the packaged module on Paper with additional JARs in
alsoInstall. - Entity discovery (both): a JAR identifies its owner, but several projects can share an output directory. In a class directory, a module discovers
@Tableentities only under its scan packages; an external plugin scans under its entry package. Move the entity under the appropriate package or declare it explicitly: seeadditionalEntitiesfor modules andconnectfor external plugins. - Descriptor dependencies (external plugins): this rule belongs to the whole test kit, not only the in-process layer. Both
@UltiToolsTestand@UltiToolsServerTestrejectsoftdependalone, because both require UltiTools to load first and its classes to be visible. Usedepend: [UltiTools]or the required Paper dependency withload: BEFOREand classpath access described in external plugin setup. - Entry class (external plugins): MockBukkit creates a subclass and calls a public no-argument constructor. Use a non-final entry class with that constructor as in the external plugin example. This loading path does not run a Paper
bootstrapperorloader; test those on the packaged JAR withprojectKind = EXTERNAL_PLUGIN.
Differences in behavior
- Resource directories (both): when Gradle outputs resources separately, startup can miss the descriptor or a message can render as its bare key. The kit reads from the entry class's output directory. Put the descriptor and
messages/beside the classes as in the module or external plugin setup, or test the packaged JAR. - Registration order (modules): the kit registers only the classes listed in
@UltiToolsTest, in the order given. It neither finds unlisted dependencies nor sorts them by dependency as UltiTools does on a server. List every required module, dependencies first, as in module setup. - Async schedules (both): a literal async
@Scheduleddelay or period follows elapsed time on Paper. Advancing mock ticks cannot establish that cadence. Use the tick helpers for tick-triggered work and check elapsed time on Paper. - Server startup (both): the framework skips bStats, update checks and their operator join notices, UltiCloud login and WebSocket connection, and console mirroring during test boot to avoid network calls and external side effects. Check these on a real server.
- Command registration (both): MockBukkit fires the registration event only on the first command dispatch, so commands registered later can be absent. List all modules and external plugins up front and avoid dispatch during module startup; see module setup.
- Storage backends (both): each test class uses isolated SQLite data. Module configuration overrides do not switch the framework's backend. To check MySQL or JSON behavior, use a server configured for that backend.
Features unsupported in process
- Bootstrap content (modules): MockBukkit has no Paper bootstrap context to install content such as enchantments. Declaring content aborts the entire module test class before any test runs; a hook that declares none can run. Test the content on Paper with the packaged module.
- Unimplemented operations (both): a Bukkit or Paper call that MockBukkit does not implement aborts the test by default if the exception reaches Jupiter. See skipped tests for exceptions caught by commands and how to turn skips into failures. Use a supported operation or check the original behavior on Paper.
A passing in-process test does not prove that component scanning works in the packaged JAR: it cannot detect missing package directory entries or shared or nested base packages across module JARs. Use @UltiToolsServerTest to check that the packaged component actually registers, and list other module JARs that may share its base package in alsoInstall, as in headless Paper tests.
Headless Paper tests
Name integration tests *IT and add Maven Failsafe to the same <plugins> element. mvn test compiles them but does not run them; mvn verify runs them after the JAR is packaged. The kit uses the resolved framework JAR. For a nonstandard project JAR location set ultitools.test.moduleJar to the built file.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>Real-server tests are skipped by default. Read the Mojang EULA. Only if you personally agree may you set the system property ultitools.test.acceptMojangEula=true or the environment variable ULTITOOLS_ACCEPT_MOJANG_EULA=true. This agreement is between you and Mojang; the kit cannot accept it for you. To skip even after accepting, set ultitools.test.skipServerTests=true.
A module goes into plugins/UltiTools/plugins/. Check its descriptor name and its command in the running server:
package org.example.welcome;
import com.ultikits.ultitools.testkit.server.RealServer;
import com.ultikits.ultitools.testkit.server.UltiToolsServerTest;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@UltiToolsServerTest
class WelcomeServerIT {
@Test
void runsThePackagedModuleOnPaper(RealServer server) {
server.assertModuleLoaded("WelcomeModule");
server.assertCommandRegistered("demowelcome");
assertEquals("Hello, traveler!", server.console("demowelcome greet"));
server.assertNoErrors();
}
}An external plugin goes into Paper’s plugins/. The connection assertion checks that Paper has enabled the packaged plugin and UltiTools currently lists it as connected, not just that it logged a message at startup:
package example.guide.welcome;
import com.ultikits.ultitools.testkit.server.RealServer;
import com.ultikits.ultitools.testkit.server.UltiToolsServerTest;
import org.junit.jupiter.api.Test;
import static com.ultikits.ultitools.testkit.server.UltiToolsServerTest.ProjectKind.EXTERNAL_PLUGIN;
import static org.junit.jupiter.api.Assertions.assertEquals;
@UltiToolsServerTest(projectKind = EXTERNAL_PLUGIN)
class WelcomeServerIT {
@Test
void packagedPluginConnectsAndReplies(RealServer server) {
server.assertExternalPluginConnected();
server.assertCommandRegistered("welcomeguide");
assertEquals("Hello from WelcomePlugin!", server.console("welcomeguide hello"));
server.assertNoErrors();
}
}RealServer.console returns synchronous plain-text replies to the console sender, not broadcasts or later async output. assertNoErrors() checks console errors and exception traces since startup. Allow-list entries match case-sensitive substrings on the opening line, not a stack frame. Inspect console.log and results.jsonl in the fresh run directory under target/ultitools-server/<class>/; Failsafe also writes its usual report.
Additional JARs
For either project kind, alsoInstall accepts a groupId:artifactId coordinate or a JAR path relative to the project directory. To use a coordinate, declare the dependency in test or provided scope. Exactly one JAR on the test classpath must contain META-INF/maven/<groupId>/<artifactId>/pom.properties for that coordinate. Otherwise, use a path. For example, a module project can add a dependency module, and an external plugin project can add a companion plugin:
package org.example.welcome;
import com.ultikits.ultitools.testkit.server.RealServer;
import com.ultikits.ultitools.testkit.server.UltiToolsServerTest;
import org.junit.jupiter.api.Test;
// Supply this additional module JAR before running this example.
@UltiToolsServerTest(alsoInstall = "test-dependencies/companion-module.jar")
class AlsoInstallExampleIT {
@Test
void loadsBothModules(RealServer server) {
server.assertModuleLoaded("WelcomeModule");
server.assertModuleLoaded("CompanionModule");
}
}package example.guide.welcome;
import com.ultikits.ultitools.testkit.server.RealServer;
import com.ultikits.ultitools.testkit.server.UltiToolsServerTest;
import org.junit.jupiter.api.Test;
import static com.ultikits.ultitools.testkit.server.UltiToolsServerTest.ProjectKind.EXTERNAL_PLUGIN;
// Before running this example, place a Paper plugin that registers companionping at this path.
@UltiToolsServerTest(projectKind = EXTERNAL_PLUGIN, alsoInstall = "fixtures/companion.jar")
class WelcomeWithCompanionIT {
@Test
void startsWithTheCompanionPlugin(RealServer server) {
server.assertExternalPluginConnected();
server.assertCommandRegistered("companionping");
server.assertNoErrors();
}
}Supply those dependencies before running the examples. The additional JAR’s own descriptor determines its destination, not the project kind, filename or array position. Paper and UltiTools still decide load order.
Network access and timeouts
Preparing a cold cache needs fill.papermc.io, the artifact host returned by Fill (currently fill-data.papermc.io), and piston-data.mojang.com. A warm cache avoids those downloads, but every fresh run directory needs Paper’s Maven Central mirror for framework runtime libraries (default maven-central.storage-download.googleapis.com).
| Limit | Setting | Default (seconds) |
|---|---|---|
| Wait for Paper readiness after cache preparation | Annotation startupTimeoutSeconds | 180 |
Wait after sending stop | Annotation shutdownTimeoutSeconds | 30 |
| HTTP idle time waiting for headers or more body bytes, not total transfer time | ultitools.test.paperDownloadIdleTimeoutSeconds | 30 |
| Total cache lock wait | ultitools.test.paperCacheLockTimeoutSeconds | 600 |
| Initial Paperclip bundle preparation | ultitools.test.paperBundleTimeoutSeconds | 180 |
Skipped tests and diagnostics
An unsupported MockBukkit operation that reaches Jupiter aborts the test. If every test in the class aborts this way the kit prints a notice. If framework command code catches and logs the unsupported operation, it is counted in a notice, not as an aborted test. Set -Dultitools.test.failOnSkip=true to fail each test aborted by an unsupported operation, and to fail when framework command code logs one before the test ends. Wait for asynchronous commands before returning. The command log check does not cover scheduled task bodies; assert their results.
In-process diagnostics start with ULTI-TEST-INPROC-; Paper diagnostics start with ULTI-TEST-SERVER-. With the test kit dependency resolved, run the Maven plugin’s docs goal and look up the identifier under target/ultitools-docs/testkit/errors/. The project guidance for coding agents explains the rest of that directory.
Ling Bao