The following code does not compile because of the following error:
"reference to assertEquals is ambiguous, both method assertEquals(java.lang.String,java.lang.Object,java.lang.Object) in junit.framework.Assert and method assertEquals(java.lang.String,long,long) in junit.framework.Assert match"
assertEquals("Some testing message....",
callThatReturnsAJavaLangLong(),
callThatReturnsAPrimativeLong() );
This can be resolved by invoking .longValue() on the call that returns a java.lang.Long, such as:
assertEquals("Some testing message....",
callThatReturnsAJavaLangLong().longValue(),
callThatReturnsAPrimativeLong() );
When I do this, IntelliJ suggests that this is "Unnecessary autoboxing" (via a code inspection). This, however, is necessary to make the code compile.
Environment: RH 9
Issue was resolved