I was wondering if assertThat() has a way of adding a custom error message ?
for example in this :
assertThat(file.exists(), is(equalTo(true)));
I would like to add some custom message, saying which file name doesnt exist
I would prefer the following, to avoid the reader believing that you wish to assert that the file name doesn't exist..!
assertThat("File name should exist", file.exists(), is(equalTo(true)));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With