{"id":"3ac8953d744169c4","repo":"junit-team/junit5","slug":"argumentsprovider-does-not-override-the-providearg","errorCode":null,"errorMessage":"ArgumentsProvider does not override the provideArguments(ParameterDeclarations, ExtensionContext) method. Please report this issue to the maintainers of %s.","messagePattern":"ArgumentsProvider does not override the provideArguments\\(ParameterDeclarations, ExtensionContext\\) method\\. Please report this issue to the maintainers of (.+?)\\.","errorType":"exception","errorClass":"JUnitException","httpStatus":null,"severity":"error","filePath":"junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java","lineNumber":86,"sourceCode":"\t *\n\t * @param parameters the parameter declarations for the parameterized\n\t * class or test; never {@code null}\n\t * @param context the current extension context; never {@code null}\n\t * @return a stream of arguments; never {@code null}\n\t * @since 5.13\n\t */\n\t@API(status = MAINTAINED, since = \"6.0.2\")\n\tdefault Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context)\n\t\t\tthrows Exception {\n\t\ttry {\n\t\t\treturn provideArguments(context);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tString message = \"\"\"\n\t\t\t\t\tArgumentsProvider does not override the provideArguments(ParameterDeclarations, ExtensionContext) method. \\\n\t\t\t\t\tPlease report this issue to the maintainers of %s.\"\"\".formatted(\n\t\t\t\tgetClass().getName());\n\t\t\tthrow new JUnitException(message, e);\n\t\t}\n\t}\n\n}\n","sourceCodeStart":68,"sourceCodeEnd":91,"githubUrl":"https://github.com/junit-team/junit5/blob/956246301e03d757539f7b76dd5a91f298637563/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java#L68-L91","documentation":"The 2-arg provideArguments default in ArgumentsProvider delegates to the deprecated 1-arg method and wraps any resulting exception in a JUnitException with this message and the underlying cause. It surfaces when a provider did not override the current 2-arg contract; the cause is typically the UnsupportedOperationException from error 62.","triggerScenarios":"A custom @ArgumentsSource provider that overrides neither provideArguments overload; the framework calls the 2-arg default, which calls the 1-arg default, which throws, and the 2-arg default wraps it here.","commonSituations":"Third-party argument provider built against an older JUnit version; refactored provider that lost its override; mismatched provider/engine versions on the classpath.","solutions":["Implement provideArguments(ParameterDeclarations, ExtensionContext) on the provider class named in the message.","Upgrade the third-party provider to a version compatible with the installed JUnit Jupiter.","If the provider is not yours and cannot be upgraded, pin JUnit to a version that matches the provider's contract."],"exampleFix":"// before\nclass MyProvider implements ArgumentsProvider {\n    // missing override -> JUnitException wrapping UnsupportedOperationException\n}\n\n// after\nclass MyProvider implements ArgumentsProvider {\n    @Override\n    public Stream<? extends Arguments> provideArguments(\n            ParameterDeclarations parameters, ExtensionContext context) {\n        return Stream.of(Arguments.of(\"a\", \"b\"));\n    }\n}","handlingStrategy":"validation","validationCode":"// Smoke-test that the provider honors the 2-arg contract before running the suite.\nArgumentsProvider p = new MyProvider();\ntry {\n    p.provideArguments(new ParameterDeclarations() { /* stub */ },\n        (ExtensionContext) () -> null);\n} catch (JUnitException e) {\n    if (e.getMessage().contains(\"does not override\")) {\n        throw new AssertionError(\"Provider needs the 2-arg override\", e);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    // run parameterized test\n} catch (JUnitException e) {\n    if (e.getMessage().contains(\"does not override the provideArguments\")) {\n        // implement the 2-arg override or upgrade/pin JUnit to match the provider\n    } else throw e;\n}","preventionTips":["Pin the JUnit version to the one a third-party provider was built against until it ships an update.","Run a tiny smoke test that instantiates each custom provider and calls the 2-arg method.","Review the cause chain of the JUnitException - it reveals the underlying UnsupportedOperationException."],"tags":["junit","jupiter-params","arguments-provider","api-migration"],"analyzedSha":"956246301e03d757539f7b76dd5a91f298637563","analyzedAt":"2026-08-04T19:25:17.049Z","schemaVersion":2}