quarkusio/quarkus · error · IllegalArgumentException
className parameter is required
Error message
className parameter is required
What it means
Dev UI's one-shot testing feature registers a JSON-RPC action to run a single test class (optionally a method). The handler requires the 'className' request parameter; when it is absent or blank, registerRunTestMethod throws IllegalArgumentException. This is a client-input validation error for the run-test endpoint.
Source
Thrown at extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/OneShotTestingProcessor.java:149
.build();
}
private void registerRunTestMethod(LaunchModeBuildItem launchModeBuildItem, BuildTimeActionBuildItem actions) {
actions.actionBuilder()
.methodName(RUN_TEST_NAME)
.description(RUN_TEST_DESC)
.parameter("className", "The fully qualified test class name, e.g. com.example.MyTest")
.parameter("methodName",
"The test method name to run. If not provided, all tests in the class are run.",
false)
.function(params -> {
Optional<TestSupport> ts = TestSupport.instance();
if (testsDisabled(launchModeBuildItem, ts)) {
return CompletableFuture.completedFuture(null);
}
String className = params.get("className");
if (className == null || className.isBlank()) {
throw new IllegalArgumentException("className parameter is required");
}
String methodName = params.get("methodName");
String testSelection = className;
if (methodName != null && !methodName.isBlank()) {
testSelection = className + "#" + methodName;
}
final String selection = testSelection;
return CompletableFuture.supplyAsync(() -> {
compileTestSources();
TestRunResults results = ts.get().runSpecificTestSynchronously(selection);
return results != null ? new TrimmedTestRunResult(results) : null;
}, executor).orTimeout(TEST_TIMEOUT_MINUTES, TimeUnit.MINUTES);
})
.enableMcpFunctionByDefault()
.build();
}
private void registerCancelTestsMethod(LaunchModeBuildItem launchModeBuildItem, BuildTimeActionBuildItem actions) {View on GitHub (pinned to e1c734241f)
Solutions
- Pass a fully-qualified test class name in the 'className' parameter, e.g. com.example.MyTest.
- Optionally include 'methodName' to target a single method; className remains mandatory.
- Check the calling code/UI for parameter naming ('className', not 'class' or 'testClass').
- Trim the value — whitespace-only strings are rejected the same as null.
Example fix
// before
Map<String, String> params = Map.of("methodName", "testFoo");
// after
Map<String, String> params = Map.of("className", "com.example.MyTest", "methodName", "testFoo"); Defensive patterns
Strategy: validation
Validate before calling
String className = params.get("className");
if (className == null || className.isBlank()) {
throw new IllegalArgumentException("Provide a fully-qualified test class name in 'className'");
} Try / catch
try { runOneShotTest(params); }
catch (IllegalArgumentException e) {
if (e.getMessage().equals("className parameter is required")) {
ui.showError("Select a test class before running");
} else throw e;
} Prevention
- Always populate className with a fully-qualified class name
- Validate request params client-side before JSON-RPC invocation
- Trim whitespace on user-supplied test names
When it happens
Trigger: Calling the Dev UI one-shot testing 'run test' action with params lacking 'className', or with className set to null/empty/whitespace — e.g. invoking the action programmatically or from a customized UI without selecting a test.
Common situations: Scripted JSON-RPC calls to the Dev UI endpoint missing the parameter; custom Dev UI extensions or scripts calling the action; tests-disabled early-return not hit because TestSupport exists, then the blank parameter slips through.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- You have to specify a key. This is the key the user will pre
- You have to specify a description. This is what the user wil
- You have to specify userMessage that will be send to AI, or
- Failed to locate 'artifact' or 'group-id' and 'artifact-id'
- No workspace path provided
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/d8f7f09dcaca6025.
Report an issue: GitHub.