{"record":{"id":"d8f7f09dcaca6025","repo":"quarkusio/quarkus","slug":"classname-parameter-is-required","errorCode":null,"errorMessage":"className parameter is required","messagePattern":"className parameter is required","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/OneShotTestingProcessor.java","lineNumber":149,"sourceCode":"                .build();\n    }\n\n    private void registerRunTestMethod(LaunchModeBuildItem launchModeBuildItem, BuildTimeActionBuildItem actions) {\n        actions.actionBuilder()\n                .methodName(RUN_TEST_NAME)\n                .description(RUN_TEST_DESC)\n                .parameter(\"className\", \"The fully qualified test class name, e.g. com.example.MyTest\")\n                .parameter(\"methodName\",\n                        \"The test method name to run. If not provided, all tests in the class are run.\",\n                        false)\n                .function(params -> {\n                    Optional<TestSupport> ts = TestSupport.instance();\n                    if (testsDisabled(launchModeBuildItem, ts)) {\n                        return CompletableFuture.completedFuture(null);\n                    }\n                    String className = params.get(\"className\");\n                    if (className == null || className.isBlank()) {\n                        throw new IllegalArgumentException(\"className parameter is required\");\n                    }\n                    String methodName = params.get(\"methodName\");\n                    String testSelection = className;\n                    if (methodName != null && !methodName.isBlank()) {\n                        testSelection = className + \"#\" + methodName;\n                    }\n                    final String selection = testSelection;\n                    return CompletableFuture.supplyAsync(() -> {\n                        compileTestSources();\n                        TestRunResults results = ts.get().runSpecificTestSynchronously(selection);\n                        return results != null ? new TrimmedTestRunResult(results) : null;\n                    }, executor).orTimeout(TEST_TIMEOUT_MINUTES, TimeUnit.MINUTES);\n                })\n                .enableMcpFunctionByDefault()\n                .build();\n    }\n\n    private void registerCancelTestsMethod(LaunchModeBuildItem launchModeBuildItem, BuildTimeActionBuildItem actions) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment/src/main/java/io/quarkus/devui/deployment/menu/OneShotTestingProcessor.java#L131-L167","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nMap<String, String> params = Map.of(\"methodName\", \"testFoo\");\n\n// after\nMap<String, String> params = Map.of(\"className\", \"com.example.MyTest\", \"methodName\", \"testFoo\");","handlingStrategy":"validation","validationCode":"String className = params.get(\"className\");\nif (className == null || className.isBlank()) {\n    throw new IllegalArgumentException(\"Provide a fully-qualified test class name in 'className'\");\n}","typeGuard":null,"tryCatchPattern":"try { runOneShotTest(params); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"className parameter is required\")) {\n        ui.showError(\"Select a test class before running\");\n    } else throw e;\n}","preventionTips":["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"],"tags":["devui","testing","validation","missing-parameter"],"backgroundTag":"missing-required-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}