Is there a nicer way to write in jUnit
String x = \"foo bar\"; Assert.assertTrue(x.contains(\"foo\"));
It's too late, but just to update I got it done with below syntax
import org.hamcrest.core.StringContains; import org.junit.Assert; Assert.assertThat("this contains test", StringContains.containsString("test"));