bbb6adb7e5571804b2db1ffa39dd2f3908dbe0a3
Introduce new package org.egothor.methodatlas.ai providing AI-assisted classification of JUnit tests for security relevance. Key changes: - add AI suggestion engine, provider abstraction, and provider clients (OpenAI-compatible, Ollama, Anthropic) - implement strict JSON prompt/response contract and taxonomy handling - integrate AI enrichment into MethodAtlas CLI output (CSV and plain modes) - add configuration via AiOptions and CLI flags - add comprehensive JUnit + Mockito test coverage for AI components and CLI integration scenarios - add realistic test fixtures for security-related test classes - update Gradle configuration for Mockito agent support on JDK 21+ - provide complete Javadoc for the AI module The AI layer is optional and degrades gracefully when providers are unavailable or responses fail.
MethodAtlasApp
MethodAtlasApp is a small standalone CLI that scans Java source trees for JUnit test methods and prints per-method
statistics:
- FQCN (fully-qualified class name)
- method name
- LOC (lines of code, based on the AST source range)
- @Tag values attached to the method (supports repeated
@Tagand@Tags({...}))
It supports two output modes:
- CSV (default)
- Plain text (
-plainas the first CLI argument)
Build & run
Assuming you have a runnable JAR (e.g. methodatlas.jar):
java -jar methodatlas.jar [ -plain ] <path1> [<path2> ...]
- If no paths are provided, the current directory (i.e.,
.) is scanned. - Multiple root paths are supported.
Output modes
CSV (default)
- Prints a header line
- Each record contains values only
- Tags are semicolon-separated in the
tagscolumn (empty if no tags)
Example:
Feb 11, 2026 1:33:35 AM org.egothor.methodatlas.MethodAtlasApp scanRoot
INFO: Scanning /tmp/junit-15560885133010516491 for JUnit files
fqcn,method,loc,tags
com.acme.tests.SampleOneTest,alpha,8,fast;crypto
com.acme.tests.SampleOneTest,beta,6,param
com.acme.tests.SampleOneTest,gamma,4,nested1;nested2
com.acme.other.AnotherTest,delta,3,
Plain text (-plain)
- Prints one line per detected method:
FQCN, method, LOC=<n>, TAGS=<tag1;tag2;...>
- If a method has no tags, it prints
TAGS=-
Example:
Feb 11, 2026 1:33:35 AM org.egothor.methodatlas.MethodAtlasApp scanRoot
INFO: Scanning /tmp/junit-12139245189413750595 for JUnit files
com.acme.tests.SampleOneTest, alpha, LOC=8, TAGS=fast;crypto
com.acme.tests.SampleOneTest, beta, LOC=6, TAGS=param
com.acme.tests.SampleOneTest, gamma, LOC=4, TAGS=nested1;nested2
com.acme.other.AnotherTest, delta, LOC=3, TAGS=-
Notes
- The scanner looks for files ending with
*Test.java. - JUnit methods are detected by annotations such as:
@Test@ParameterizedTest@RepeatedTest
- Tag extraction supports:
@Tag("x")(including repeated@Tag)@Tags({ @Tag("x"), @Tag("y") })
Description
Releases
5
release@1.1.1
Latest
Languages
Java
100%