com.frotty27.hrtk.api.annotation package. This page is a quick-reference table with brief descriptions and links to the relevant documentation.
Test Markers
These annotations mark methods as tests or benchmarks. At least one must be present for HRTK to discover the method.| Annotation | Target | Description | Docs |
|---|---|---|---|
@HytaleTest | Method | Primary test marker. Optional display name parameter. | Your First Test |
@EcsTest | Method | ECS-level test. Injects EcsTestContext, adds "ecs" tag. | ECS Testing |
@WorldTest | Method | World-level test. Injects WorldTestContext, adds "integration" tag. | World Testing |
@CombatTest | Method | Combat test. Provides WorldTestContext for combat scenarios. | Stats & Combat |
@StatsTest | Method | Stats-focused test. Marker for stat-related testing. | Stats & Combat |
@InventoryTest | Method | Inventory test. Marker for inventory-related testing. | Inventory & Loot |
@SpawnTest | Method | Spawn test. Marker for entity spawning scenarios. | World Testing |
@FlowTest | Method | Multi-step flow test. world and timeoutTicks parameters. | Flow Tests |
@AsyncTest | Method | Async test with timeoutTicks for tick-based timeout. | Async & Tick Waiting |
@Benchmark | Method | Performance benchmark. warmup, iterations, batchSize. | Benchmarks |
@RepeatedTest | Method | Run N times. Each repetition reported separately. | Timeouts & Repetition |
@ParameterizedTest | Method | Run with multiple values from @ValueSource. | Parameterized Tests |
Configuration
These annotations configure how tests behave.| Annotation | Target | Description | Docs |
|---|---|---|---|
@HytaleSuite | Class | Suite marker. value (name), isolation (strategy). | Test Suites |
@Tag | Class/Method | String tag(s) for filtering. Multiple values supported. | Filtering & Tags |
@Order | Method | Execution order within suite. Lower values run first. | Filtering & Tags |
@DisplayName | Method | Override the display name in results. | Filtering & Tags |
@Disabled | Class/Method | Skip the test/suite. Optional reason string. | Filtering & Tags |
@Timeout | Method | Maximum duration. value + unit (default seconds). | Timeouts & Repetition |
@ValueSource | Method | Parameter values for @ParameterizedTest. ints, strings, doubles, etc. | Parameterized Tests |
Requirements
These annotations declare preconditions for test execution.| Annotation | Target | Description | Docs |
|---|---|---|---|
@RequiresWorld | Method | Test needs a world. Optional value for world name. | World Testing |
@RequiresPlayer | Method | Test needs player-like context. Optional count. | Command Testing |
@RequiresPlugin | Method | Test needs a specific plugin loaded. Skipped if absent. | How It Works |
Lifecycle
These annotations mark setup and teardown methods.| Annotation | Target | Description | Docs |
|---|---|---|---|
@BeforeAll | Method | Run once before the first test. Can be static. | Lifecycle Hooks |
@AfterAll | Method | Run once after the last test. Can be static. | Lifecycle Hooks |
@BeforeEach | Method | Run before every test method. Instance method. | Lifecycle Hooks |
@AfterEach | Method | Run after every test method. Instance method. | Lifecycle Hooks |
Usage Pattern
A typical test class uses a combination of these annotations:Next Steps
- Contexts Reference — context interfaces and their methods
- Your First Test — getting started
- How It Works — architecture overview