-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 4.12 converts null string parameters to "null"s #1488
Comments
I created a project stefanbirkner/junit4-issue-1488 for verifying the issue. I cannot reproduce the failure with Java 8. @MGhareeb32 Can you please verify that the example project is failing for you, too. |
Thanks, @stefanbirkner ; I was going to do the same thing :-) I noticed Android classes on the call stack. @MGhareeb32 does this happen for projects that don't depend on Android? |
Thanks @stefanbirkner and @kcooney. |
I'm afraid I'm not able to reproduce outside of the Android setup I have. I tried to change @stefanbirkner's repo to use the same dependencies my Android repo has, but no luck. |
@MGhareeb32 Can you change my repo so that it has an Android setup? |
Will get back to you later today :) |
If you are able to launch your tests in a debugger, I suggest doing that. |
I just ran into this today. It was very painful. |
@npmccallum we only closed this because no one could reproduce it with vanilla JUnit 4.12. Could you provide a reproducible test case? |
I also just ran into this today, and it specifically occurs when I run my JUnit Android Espresso test on an Emulator running API 23, but not with 26 or greater. Building on Java 8, with Android SDK 28. |
@dabrosch my guess is that this is Android-specific, which is why the JUnit team hasn't been able to reproduce it. Could you use a debugger to try to figure out why you are getting this failure message? |
I can confirm that the result of Arrays.asList(new Object[][] { {null} } is the exact same when executing on Android API 23 or 26, therefore it must be in the Parameter assignment to a string that is coercing it into a String "null." |
When running the following test with
junitLibVersion = "4.12"
:I get the following assertion failure:
The text was updated successfully, but these errors were encountered: