Class MethodAtlasApp
The application traverses one or more directory roots, parses matching source
files using JavaParser, identifies supported JUnit Jupiter test methods, and
emits one output record per discovered test method. File selection matches
source files whose names end with the configured suffix (default:
Test.java).
Source-Derived Metadata
For each discovered test method, the application reports:
- fully qualified class name
- method name
- inclusive line count of the method declaration
- JUnit
@Tagvalues declared on the method
AI Enrichment
When AI support is enabled, the application submits each discovered test
class to an AiSuggestionEngine and merges
the returned method-level suggestions into the emitted output.
Manual AI Workflow
Operators who cannot access an AI API directly can use the two-phase manual workflow:
- Prepare phase (
-manual-prepare): the application scans test sources and writes one work file per class to the specified directory. Each work file contains operator instructions and the full AI prompt (with class source embedded). No CSV output is produced in this phase. - Consume phase (
-manual-consume): the application reads operator-saved AI response files (<stem>.response.txt) from the response directory and produces the final enriched CSV. Classes whose response file is absent receive empty AI columns.
Supported Command-Line Options
-config <path>— loads default values from a YAML configuration file; command-line flags override YAML values-plain— emits plain text output instead of CSV-sarif— emits SARIF 2.1.0 JSON output-ai— enables AI-based enrichment-ai-provider <provider>— selects the AI provider-ai-model <model>— selects the provider-specific model-ai-base-url <url>— overrides the provider base URL-ai-api-key <key>— supplies the AI API key directly-ai-api-key-env <name>— resolves the AI API key from an environment variable-ai-taxonomy <path>— loads taxonomy text from an external file-ai-taxonomy-mode <mode>— selects the built-in taxonomy variant-ai-max-class-chars <count>— limits class source size submitted to AI-ai-timeout-sec <seconds>— sets the AI request timeout-ai-max-retries <count>— sets the retry limit for AI operations-ai-confidence— requests a confidence score for each AI security classification; adds anai_confidencecolumn to the output-file-suffix <suffix>— matches source files by name suffix (default:Test.java); may be repeated to match multiple patterns, e.g.-file-suffix Test.java -file-suffix IT.java; the first occurrence replaces the default-test-annotation <name>— recognises methods annotated withnameas test methods; may be repeated; the first occurrence replaces the default set (AnnotationInspector.DEFAULT_TEST_ANNOTATIONS)-emit-metadata— emits# key: valuecomment lines before the header row describing the tool version, scan timestamp, and taxonomy configuration-apply-tags— instead of emitting a report, writes AI-generated@DisplayNameand@Tagannotations back to the scanned source files; requires AI enrichment to be enabled-content-hash— includes a SHA-256 fingerprint of each class source as acontent_hashcolumn in CSV/plain output and as a SARIF property; useful for detecting which classes changed between scans-manual-prepare <workdir> <responsedir>— runs the manual AI prepare phase, writing work files toworkdirand empty response stubs toresponsedir; the two paths may be identical-manual-consume <workdir> <responsedir>— runs the manual AI consume phase, reading response files fromresponsedirand emitting the final enriched CSV
Any remaining non-option arguments are interpreted as root paths to scan. If no scan path is supplied, the current working directory is scanned.
Exit Codes
0— all files processed successfully1— one or more files could not be parsed or processed
- See Also:
-
Method Summary
-
Method Details
-
main
Program entry point.Delegates all work to
run(String[], PrintWriter). Exits with a non-zero status code if any source file could not be processed.- Parameters:
args- command-line arguments- Throws:
IOException- if traversal of a configured file tree failsIllegalArgumentException- if an option is unknown, if a required option value is missing, or if an option value cannot be parsedIllegalStateException- if AI support is enabled but the AI engine cannot be created successfully
-