Invert arguments on JUnity assertEquals
Answered
For some reason we have a large amount of JUnity "assertEquals" that have the "expected" and "actual" arguments inverted:
assertEquals(<actual>, <expected>);
instead of
assertEquals(<expected>, <actual>);
Any chance of a spell to swap them?
Please sign in to leave a comment.
Not sure IntelliJ IDEA caused it.
You can revert them back using structural replace: https://www.jetbrains.com/help/idea/structural-search-and-replace.html
That's perfect, it worked, that's a very powerful feature!
Looks like the code inspection use that right, very interesting indeed.
Anyway thanks!
BTW, it was not IntelliJ, it was always like this, we just hadn't noticed.