While working on Assignment 2 for the Java course, I received this error:
Missing 1 invocation to:
org.junit.Assert#assertEquals(any String, any String)
Caused by: Missing invocations
We’re using JUnit to do some Test-Driven Development, and writing tests to make sure our code hits design goals. I found that the error above is caused when the testing code is expecting me to test using an assertEquals(String, String) method. Initially, I tried using assertTrue and assertEquals(boolean, boolean) methods, and both used the error. It’s specifically looking for an assertEquals method that compares to Strings, not any other type of variable.
It’s odd and confusing because it wasn’t pointing to my code as the problem, but the testing code. Changing my code fixed it, though. Hope this helps!