I prefer this, as it can be read as a sentence: "claim that the file" myFile "exists: myFile exists true"
assertThat("File '" + myFile + "' exists", myFile.exists(), is(true));
And a read message also appears with all the necessary information when it fails:
java.lang.AssertionError: File '/blah' exists Expected: is <true> but: was <false>
chipiik
source share