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

TestPlan Components

Key Classes

  • TestPlanProvider - Main entry point; expands a TestPlan into a Stream<DynamicNode> for JUnit 5 @TestFactory methods, with configurable max depth and optional PlantUML recording
  • TestPlanParser - Parses hand-authored TestPlan JSON using Jackson (HAPI FHIR R5 TestPlan support pending)
  • DependencyResolver - Builds the dependency graph and determines topological execution order
  • CycleDetector - Detects circular references in the TestPlan graph and throws on violation
  • JUnitTestGenerator - Converts resolved test nodes into JUnit DynamicTest and DynamicContainer objects
  • PlantUMLRecorder - Optionally records the discovered test structure as a PlantUML diagram for documentation
  • TestPlanResource - Jackson-mapped model for the TestPlan JSON structure
  • TestNode - Node in the dependency graph, wrapping a TestScript or nested TestPlan reference
  • VariableContext - 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");
     }
 }