Var args for StringAssert::contains() #120

tedyoung opened this Issue Oct 27, 2012 · 2 comments


None yet

2 participants


Recently I've found myself doing this:

String json = getPolicyInfoFromRemoteSystem();

Yes, I could use a regex, but then it looks like this:


Which while more concise, is a bit ugly because of the escaping needed. It gets worse, though, if I don't know (and/or care about) the order, e.g., if I want to assert that the string contains {, }, coverages, and vehicle:


So it'd be nice if the contains() method on StringAssert took a var args of String, e.g.:

    .contains("{", "}", "coverages", "vehicle");

It's similar to the usage of contains() for iterables.


I agree it would be handy, thanks for reporting this.


For your information, this issue has been fixed in AssertJ a fork of Fest Assert 2.0M10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment