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

JUnit 5 ParameterizedTest results not properly flagged for complex arguments #1603

Open
JGitHub01 opened this issue Sep 9, 2023 · 4 comments

Comments

@JGitHub01
Copy link

When parameters for a ParameterizedTest is provided by MethodSource that return stream of Arguments of non primitive type e.g. double[], the test results are not flagged with a green check for success test. Instead, it shows a grey circle without a dropdown that show test result for each test case.

image

Example Code:

public class ExampleTest {
  @ParameterizedTest
  @MethodSource("parameters")
  void shouldDoParameterizedTest(double[] s) {
    assertNotNull(s[0]);
    assertNotNull(s[1]);
  }

  static Stream<Arguments> parameters() {
    return Stream.of(Arguments.of(new double[] {
        0.01d, 0.05d
    }), Arguments.of(new double[] {
        0.02d, 0.04d
    }));
  }
}
@JGitHub01
Copy link
Author

Looks like passing array such as double[] is what cause the issue. If I pass List<Double> as the argument, the issue goes away.

@jdneo jdneo added the bug label Sep 10, 2023
@jdneo
Copy link
Member

jdneo commented Sep 10, 2023

Thank s for reporting the issue. Looks like it's due to the different parameter type name returned from the item searcher and runner.

The searcher uses double[] while the runner is referencing the method using the binary name of the parameter type: [D, this mismatch causes the error.

@jdneo
Copy link
Member

jdneo commented Sep 18, 2023

Any contribution is welcome about this issue.

// I can try to fix this issue as well if I find a time.

@mapio
Copy link

mapio commented Sep 28, 2023

I think this may be related to #1617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants