@Test public void shouldNotPassForNullValue() { // given expectedException.expect(WebSuitesException.class); // then sut.validateParam(null); }
@Parameters({"true", "false", "TRUE", "FALSE", "True", "False"}) @Test public void shouldPassBooleanParamValidation(String param) { // given param // when sut.validateParam(param); // then OK }
@Parameters({"", "f", "t", "yes", "no", "TRUEe", "FALSEE"}) @Test public void shouldNotPassBooleanParamValidation(String param) { // given expectedException .expect(WebSuitesException.class) .hasMessageContaining("must be proper BOOLEAN value") .hasMessageContaining("testParam") .hasMessageContaining(param); // then sut.validateParam(param); }