Archive for the 'JUnit' Category

Aug 31 2009

JUnit 4 error: reference to assertEquals is ambiguous

Published by under Java,JUnit,Testing

This is a somewhat confusing compilation failure that sometimes happen when you write unit tests using JUnit 4. This is an example code snippet that produces this error (result.getValue() returns an Integer object): assertEquals(12345, result.getValue()); And when you try to compile your project it produces a compilation error like this: /projects/myapp/src/test/java/org/myapp/[88,8] reference to assertEquals is […]

4 responses so far