@Test public void shouldThrowExceptionForInvalidString() { try { converter.convert("not a boolean!", boolean.class, bundle); Assert.assertTrue(false); } catch (ConversionError e) { assertThat(e.getMessage(), is(equalTo("NOT A BOOLEAN! is not a valid boolean. Please use true/false, yes/no, y/n or on/off"))); } }
public Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return false; } return booleanConverter.convert(value, type, bundle); }
PrimitiveBooleanConverter implements Converter<Boolean> { public Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return false; } return booleanConverter.convert(value, type, bundle); } }
PrimitiveBooleanConverter implements Converter<Boolean> { public Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return false; } return booleanConverter.convert(value, type, bundle); }  }
PrimitiveBooleanConverter implements Converter<Boolean> { public Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return false; } return booleanConverter.convert(value, type, bundle); }  Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle); }
PrimitiveBooleanConverter implements Converter<Boolean> { public Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle) { if (isNullOrEmpty(value)) { return false; } return booleanConverter.convert(value, type, bundle); }  Boolean convert(String value, Class<? extends Boolean> type, ResourceBundle bundle);  }