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_.CraftingAssert;
import com.frotty27.hrtk.api.assert_.HytaleAssert;
import com.frotty27.hrtk.api.lifecycle.IsolationStrategy;
import java.util.List;
@HytaleSuite(value = "Crafting Surface Tests", isolation = IsolationStrategy.NONE)
@Tag("crafting")
public class CraftingSurfaceTests {
@HytaleTest
@Order(1)
@DisplayName("Known recipe exists in the registry")
void knownRecipeExists() {
// assertRecipeExists checks the recipe registry for the given ID.
// If the recipe is not found, the test fails with a descriptive message.
CraftingAssert.assertRecipeExists("Weapon_Sword_Wooden");
}
@HytaleTest
@Order(2)
@DisplayName("Server has a minimum number of recipes loaded")
void minimumRecipeCount() {
// assertRecipeCount checks that at least N recipes are registered.
// This catches bulk registration failures where an entire recipe file
// fails to load silently.
CraftingAssert.assertRecipeCount(50);
}
@HytaleTest
@Order(3)
@DisplayName("List all recipe IDs for debugging")
void listRecipeIdsForVerification() {
// The adapter's listRecipeIds() returns all registered recipe IDs.
// Useful for debugging when a recipe assertion fails.
List<String> recipes = CraftingTestAdapter.listRecipeIds();
HytaleAssert.assertNotNull("Recipe list should not be null", recipes);
HytaleAssert.assertNotEmpty(recipes);
}
@HytaleTest
@Order(4)
@DisplayName("Crafting plugin is available")
void craftingPluginPresent() {
// craftingPluginAvailable checks if the crafting plugin class is on the classpath.
// If this fails, no recipe tests will work.
HytaleAssert.assertTrue(
"Crafting plugin should be available",
CraftingTestAdapter.craftingPluginAvailable()
);
}
}