package com.example.tests;
import com.frotty27.hrtk.api.annotation.HytaleSuite;
import com.frotty27.hrtk.api.annotation.HytaleTest;
import com.frotty27.hrtk.api.annotation.Tag;
import com.frotty27.hrtk.api.annotation.DisplayName;
import com.frotty27.hrtk.api.annotation.Order;
import com.frotty27.hrtk.api.assert_.HytaleAssert;
import com.frotty27.hrtk.api.assert_.PluginAssert;
import com.frotty27.hrtk.api.lifecycle.IsolationStrategy;
import java.util.List;
@HytaleSuite(value = "Plugin Surface Tests", isolation = IsolationStrategy.NONE)
@Tag("plugins")
public class PluginSurfaceTests {
@HytaleTest
@Order(1)
@DisplayName("HRTK plugin is loaded")
void hrtkPluginLoaded() {
// assertPluginLoaded searches the PluginManager by name.
// If the plugin is not found, the test fails with a clear message.
PluginAssert.assertPluginLoaded("hrtk");
}
@HytaleTest
@Order(2)
@DisplayName("Expected plugin count matches")
void expectedPluginCount() {
// assertPluginCount expects an exact match.
// Adjust the number to match your server's expected plugin count.
PluginAssert.assertPluginCount(3);
}
@HytaleTest
@Order(3)
@DisplayName("List all loaded plugin names")
void listLoadedPlugins() {
// getPluginNames returns all loaded plugin names.
// Useful for debugging when a plugin assertion fails.
List<String> plugins = PluginTestAdapter.getPluginNames();
HytaleAssert.assertNotNull("Plugin names list should not be null", plugins);
HytaleAssert.assertNotEmpty(plugins);
}
@HytaleTest
@Order(4)
@DisplayName("Plugin instance is accessible by name")
void pluginInstanceAccessible() {
Object plugin = PluginTestAdapter.getPlugin("hrtk");
HytaleAssert.assertNotNull(
"Plugin instance should be accessible",
plugin
);
}
}