BooleanValueConverter extends AbstractValueConverter<Boolean> { @Override public Boolean convertValue(final Value value, final Thing thing, final Class<? extends Boolean> desiredType) throws ValueConversionException { try { return ((Literal) value).booleanValue(); } catch (Exception e) { throw new ValueConversionException("Issue converting '" + value.stringValue() + "' to boolean", e); } } BooleanValueConverter(); @Override Boolean convertValue(final Value value, final Thing thing, final Class<? extends Boolean> desiredType); @Override Value convertType(final Boolean value, final Thing thing);  }
@Test(expected = ValueConversionException.class) public void testBad() { Value badVal = valueFactory.createLiteral(100L); this.valueConverter.convertValue(badVal, null, null); }