StringToLocalDateTime extends StringToString { @Override public void validate(Class<?> type, int size, int decimals) { if(!(LocalDateTime.class.isAssignableFrom(type))) { throw new TypeConverterException("Only supports converting to and from an Enum that is or extends from LocalDateTime"); } }  @Override void initialize(TypeConverterConfig config); @Override void validate(Class<?> type, int size, int decimals); @Override Object to(byte[] bytes, int offset, int length, int decimals, boolean removePadding); @Override byte[] from(Object value, int length, int decimals, boolean addPadding);  }
@Test public void testValidateSuccess() throws Exception { typeConverter.validate(LocalDateTime.class, 2, -1); }
@Test(expected = TypeConverterException.class) public void testValidateFail() throws Exception { typeConverter.validate(Long.TYPE, 2, -1); }