Package org.fhirfrog.frog.testplan
package org.fhirfrog.frog.testplan
TestPlan expansion, cycle detection, and JUnit dynamic test generation.
This package implements FHIR TestPlan support: loading a TestPlan resource, recursively resolving its TestScript and nested TestPlan references, detecting dependency cycles, and producing a stream of JUnit 5 dynamic tests in topological execution order.
Architecture
Key Classes
TestPlanProvider- Main entry point; expands a TestPlan into aStream<DynamicNode>for JUnit 5@TestFactorymethods, with configurable max depth and optional PlantUML recordingTestPlanParser- Parses hand-authored TestPlan JSON using Jackson (HAPI FHIR R5 TestPlan support pending)DependencyResolver- Builds the dependency graph and determines topological execution orderCycleDetector- Detects circular references in the TestPlan graph and throws on violationJUnitTestGenerator- Converts resolved test nodes into JUnitDynamicTestandDynamicContainerobjectsPlantUMLRecorder- Optionally records the discovered test structure as a PlantUML diagram for documentationTestPlanResource- Jackson-mapped model for the TestPlan JSON structureTestNode- Node in the dependency graph, wrapping a TestScript or nested TestPlan referenceVariableContext- Propagates variables across test cases within a TestPlan execution
Usage
@ExtendWith(FhirFrogExtension.class)
class AUCoreSuite {
@TestFactory
Stream<DynamicNode> auCore(FhirTestConfig config) {
return new TestPlanProvider(config.getServerUrl(), config.getFixtureBasePath())
.provide("au-core-suite.json");
}
}
-
ClassesClassDescriptionGenerates JUnit 5 dynamic tests from FHIR R5 TestPlan resources.Parser for hand-coded TestPlan resources.JUnit 5 dynamic test provider for recursive TestPlan execution.Minimal hand-coded TestPlan resource for test execution.Hierarchical variable context for test execution.