{"record":{"id":"994e7429add32343","repo":"junit-team/junit5","slug":"please-implement-providearguments-parameterdeclara","errorCode":null,"errorMessage":"Please implement provideArguments(ParameterDeclarations, ExtensionContext) instead.","messagePattern":"Please implement provideArguments\\(ParameterDeclarations, ExtensionContext\\) instead\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java","lineNumber":61,"sourceCode":" * @see org.junit.jupiter.params.support.AnnotationConsumer\n */\n@API(status = STABLE, since = \"5.7\")\npublic interface ArgumentsProvider {\n\n\t/**\n\t * Provide a {@link Stream} of {@link Arguments} to be passed to a\n\t * {@code @ParameterizedTest} method.\n\t *\n\t * @param context the current extension context; never {@code null}\n\t * @return a stream of arguments; never {@code null}\n\t * @deprecated Please implement\n\t * {@link #provideArguments(ParameterDeclarations, ExtensionContext)} instead.\n\t */\n\t@Deprecated(since = \"5.13\")\n\t@API(status = DEPRECATED, since = \"5.13\")\n\tdefault Stream<? extends Arguments> provideArguments(@SuppressWarnings(\"unused\") ExtensionContext context)\n\t\t\tthrows Exception {\n\t\tthrow new UnsupportedOperationException(\n\t\t\t\"Please implement provideArguments(ParameterDeclarations, ExtensionContext) instead.\");\n\t}\n\n\t/**\n\t * Provide a {@link Stream} of {@link Arguments} to be passed to a\n\t * {@code @ParameterizedClass} or {@code @ParameterizedTest}.\n\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);","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/junit-team/junit5/blob/f070c699a08b5d8393df9afd147af5c5e90bb21b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java#L43-L79","documentation":"Thrown by the deprecated default method provideArguments(ExtensionContext) on the ArgumentsProvider interface. Since 5.13 the contract requires implementing provideArguments(ParameterDeclarations, ExtensionContext); the old default now throws UnsupportedOperationException to signal that it must not be relied on. This surfaces only when an ArgumentsProvider does not implement the new method.","triggerScenarios":"An ArgumentsProvider implementation does not override provideArguments(ParameterDeclarations, ExtensionContext). The framework's default bridge calls the deprecated provideArguments(ExtensionContext), whose default body throws UnsupportedOperationException.","commonSituations":"Custom ArgumentsProvider written against pre-5.13 API after upgrading JUnit. Library-provided provider that has not migrated to the new signature.","solutions":["Implement provideArguments(ParameterDeclarations, ExtensionContext) in the ArgumentsProvider.","Upgrade or replace third-party ArgumentsProvider implementations with versions targeting JUnit 5.13+.","If you only had the old method, rename/rewrite its signature to the new parameterized form."],"exampleFix":"// before\n@Override\npublic Stream<? extends Arguments> provideArguments(ExtensionContext ctx) { ... }\n\n// after\n@Override\npublic Stream<? extends Arguments> provideArguments(ParameterDeclarations params, ExtensionContext ctx) { ... }","handlingStrategy":"validation","validationCode":"// Confirm the provider implements the new signature\nboolean hasNew = Arrays.stream(providerClass.getMethods())\n    .anyMatch(m -> m.getName().equals(\"provideArguments\")\n        && m.getParameterCount() == 2\n        && !m.isDefault());\nif (!hasNew) throw new IllegalStateException(\"ArgumentsProvider must implement provideArguments(ParameterDeclarations, ExtensionContext)\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When implementing ArgumentsProvider, override the new 2-arg method, not the deprecated 1-arg one.","Run a smoke parameterized test after upgrading JUnit to catch un-migrated providers early.","Track deprecations in release notes each upgrade."],"tags":["junit-jupiter","arguments-provider","deprecation","migration"],"backgroundTag":null,"analyzedSha":"f070c699a08b5d8393df9afd147af5c5e90bb21b","analyzedAt":"2026-08-11T20:31:00.530Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}