Skip to content

JUnit Assert.assertNotNull(nonLiteralIntendedToBeNullChecked, "literal string that is actually null checked") #212

@cushon

Description

@cushon

Original issue created by [email protected] on 2013-11-15 at 06:15 PM


The parameters are reversed from what is intended. In both JUnit 3 and JUnit 4, the first parameter is the message, and the second is the object to be tested.

http://junit.sourceforge.net/junit3.8.1/javadoc/junit/framework/Assert.html#assertNotNull(java.lang.String, java.lang.Object)
http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertNotNull(java.lang.String, java.lang.Object)

I see about a dozen instances of this problem in Google code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions