Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parameterized ArgumentSource annotations repeatable #3787

Merged
merged 20 commits into from
May 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add integration test for repeated @ArgumentsSource
  • Loading branch information
Madalin Giurca authored and madalingiurca committed Apr 25, 2024
commit 468365955e451cd4e9f7becba91c760010a17624
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,18 @@ void executesWithRepeatableFieldSource() {
event(test(), displayName("[2] argument=other"), finishedWithFailure(message("other"))));
}

@Test
void executesWithRepeatableArgumentsSource() {
var results = execute("testWithRepeatableArgumentsSource", String.class);
results.allEvents().assertThatEvents() //
.haveExactly(1, event(test(), displayName("[1] argument=foo"), finishedWithFailure(message("foo")))) //
.haveExactly(1, event(test(), displayName("[2] argument=bar"), finishedWithFailure(message("bar")))) //
.haveExactly(1, event(test(), displayName("[3] argument=foo"), finishedWithFailure(message("foo")))) //
.haveExactly(1,
event(test(), displayName("[4] argument=bar"), finishedWithFailure(message("bar"))));

}

@Test
void executesWithSameRepeatableAnnotationMultipleTimes() {
var results = execute("testWithSameRepeatableAnnotationMultipleTimes", String.class);
Expand Down Expand Up @@ -2074,6 +2086,13 @@ void testWithSameRepeatableAnnotationMultipleTimes(String argument) {
void testWithDifferentRepeatableAnnotations(String argument) {
fail(argument);
}

@ParameterizedTest
@ArgumentsSource(TwoSingleStringArgumentsProvider.class)
@ArgumentsSource(TwoUnusedStringArgumentsProvider.class)
void testWithRepeatableArgumentsSource(String argument) {
fail(argument);
}
}

private static class TwoSingleStringArgumentsProvider implements ArgumentsProvider {
Expand Down