{"record":{"id":"e3fe5f35c0902ae8","repo":"OpenAPITools/openapi-generator","slug":"test-tool-testtool-is-not-supported-or-misspel","errorCode":null,"errorMessage":"Test tool \"{testTool}\" is not supported or misspelled.","messagePattern":"Test tool \"(.+?)\" is not supported or misspelled\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java","lineNumber":287,"sourceCode":"                case OPT_BUILD_GRADLE:\n                case OPT_BUILD_MAVEN:\n                case OPT_BUILD_ALL:\n                    this.buildTool = (String) additionalProperties.get(OPT_BUILD);\n                    break;\n                default:\n                    throw new RuntimeException(\"Build tool \\\"\" + additionalProperties.get(OPT_BUILD) + \"\\\" is not supported or misspelled.\");\n            }\n        }\n        additionalProperties.put(OPT_BUILD, buildTool);\n\n        if (additionalProperties.containsKey(OPT_TEST)) {\n            switch ((String) additionalProperties.get(OPT_TEST)) {\n                case OPT_TEST_JUNIT:\n                case OPT_TEST_SPOCK:\n                    this.testTool = (String) additionalProperties.get(OPT_TEST);\n                    break;\n                default:\n                    throw new RuntimeException(\"Test tool \\\"\" + additionalProperties.get(OPT_TEST) + \"\\\" is not supported or misspelled.\");\n            }\n        }\n        additionalProperties.put(OPT_TEST, testTool);\n        if (testTool.equals(OPT_TEST_JUNIT)) {\n            additionalProperties.put(\"isTestJunit\", true);\n        } else if (testTool.equals(OPT_TEST_SPOCK)) {\n            additionalProperties.put(\"isTestSpock\", true);\n        }\n\n        if (additionalProperties.containsKey(OPT_GENERATE_SWAGGER_ANNOTATIONS)) {\n            String value = String.valueOf(additionalProperties.get(OPT_GENERATE_SWAGGER_ANNOTATIONS));\n            switch (value) {\n                case OPT_GENERATE_SWAGGER_ANNOTATIONS_SWAGGER_1:\n                    this.generateSwaggerAnnotations = OPT_GENERATE_SWAGGER_ANNOTATIONS_SWAGGER_1;\n                    break;\n                case OPT_GENERATE_SWAGGER_ANNOTATIONS_SWAGGER_2:\n                case OPT_GENERATE_SWAGGER_ANNOTATIONS_TRUE:\n                    this.generateSwaggerAnnotations = OPT_GENERATE_SWAGGER_ANNOTATIONS_SWAGGER_2;","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautAbstractCodegen.java#L269-L305","documentation":"Thrown by JavaMicronautAbstractCodegen.processOpts while validating the 'test' additional property (OPT_TEST) for the java-micronaut / java-micronaut-server generators. The switch only wires two test frameworks: 'junit' (OPT_TEST_JUNIT) and 'spock' (OPT_TEST_SPOCK, Groovy-based); any other string aborts generation before any file is written. If 'test' is not supplied, the generator defaults to junit.","triggerScenarios":"Running `openapi-generator-cli generate -g java-micronaut-server -i api.yaml -p test=junit5` (or any value other than exactly 'junit' or 'spock': 'Junit', 'spock2', 'testng', 'junit-jupiter'). Also reachable via the additionalProperties block of a YAML/JSON config file, or programmatically through addAdditionalProperty(\"test\", value).","commonSituations":"Copying CLI options from a Spring/Quarkus generator recipe that names test frameworks differently (junit5, junit-jupiter); assuming version-suffixed names are aliases; stray whitespace or smart quotes around the value in YAML/JSON config files.","solutions":["Set `-p test=junit` or `-p test=spock` (exact, case-sensitive strings).","Omit the 'test' option entirely — the generator defaults to junit.","If you pasted options from another generator's docs, re-check against `openapi-generator-cli config-help -g java-micronaut-server`, which lists exactly junit and spock for testToolMap.","Inspect the value in your config file for trailing spaces or non-ASCII quotes."],"exampleFix":"# before\nopenapi-generator-cli generate -g java-micronaut-server -i api.yaml -p test=junit5\n# after\nopenapi-generator-cli generate -g java-micronaut-server -i api.yaml -p test=junit","handlingStrategy":"validation","validationCode":"# shell: gate the option before invoking the CLI\ntest_tool=\"${TEST_TOOL:-junit}\"\ncase \"$test_tool\" in\n  junit|spock) ;;\n  *) echo \"test must be 'junit' or 'spock', got: $test_tool\" >&2; exit 2 ;;\nesac\nopenapi-generator-cli generate -g java-micronaut-server -i api.yaml -p test=\"$test_tool\"","typeGuard":"private static final java.util.Set<String> MICRONAUT_TEST_TOOLS = java.util.Set.of(\"junit\", \"spock\");\n\nboolean isValidMicronautTestTool(String value) {\n    return value != null && MICRONAUT_TEST_TOOLS.contains(value);\n}","tryCatchPattern":"try {\n    new DefaultGenerator().opts(clientOptInput).generate();\n} catch (RuntimeException e) {\n    // deterministic config error: report and stop, never retry\n    throw new IllegalStateException(\"Micronaut generator config rejected: \" + e.getMessage(), e);\n}","preventionTips":["Keep per-generator option allowlists in one build script instead of hand-typed -p flags.","Run `openapi-generator-cli config-help -g java-micronaut-server` once and pin the printed enum values.","Treat any 'not supported or misspelled' message as a typo in an option value, not a generator bug."],"tags":["openapi-generator","java","micronaut","configuration","test-framework"],"backgroundTag":"invalid-generator-option-value","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}