@Test public void checkRequest_ko() { expectedException.expect(BadRequestException.class); expectedException.expectMessage("Missing param: foo"); WsUtils.checkRequest(false, "Missing param: %s", "foo"); }
@Test public void checkRequest_ok() { WsUtils.checkRequest(true, "Missing param: %s", "foo"); // do not fail }