Search in sources :

Example 6 with MapperBuilderErrorHandler

use of org.simpleflatmapper.map.MapperBuilderErrorHandler in project SimpleFlatMapper by arnaudroger.

the class JdbcMapperErrorTest method testHandleMapperErrorGetterNotFound.

@Test
public void testHandleMapperErrorGetterNotFound() throws NoSuchMethodException, SecurityException, IOException {
    MapperBuilderErrorHandler errorHandler = mock(MapperBuilderErrorHandler.class);
    JdbcMapperBuilder<MyClass> builder = JdbcMapperFactoryHelper.asm().mapperBuilderErrorHandler(errorHandler).newBuilder(MyClass.class);
    builder.addMapping("prop", 1);
    builder.mapper();
    verify(errorHandler).accessorNotFound("Could not find getter for ColumnKey [columnName=prop, columnIndex=1, sqlType=-99999] type class org.simpleflatmapper.test.beans.Foo path prop See https://github.com/arnaudroger/SimpleFlatMapper/wiki/Errors_CSFM_GETTER_NOT_FOUND");
}
Also used : MapperBuilderErrorHandler(org.simpleflatmapper.map.MapperBuilderErrorHandler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 MapperBuilderErrorHandler (org.simpleflatmapper.map.MapperBuilderErrorHandler)6 Type (java.lang.reflect.Type)3 DbObject (org.simpleflatmapper.test.beans.DbObject)3 FieldKey (org.simpleflatmapper.map.FieldKey)2 IgnoreMapperBuilderErrorHandler (org.simpleflatmapper.map.IgnoreMapperBuilderErrorHandler)2 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)2 CsvWriter (org.simpleflatmapper.csv.CsvWriter)1 ConsumerErrorHandler (org.simpleflatmapper.map.ConsumerErrorHandler)1 FieldMapperErrorHandler (org.simpleflatmapper.map.FieldMapperErrorHandler)1 MappingException (org.simpleflatmapper.map.MappingException)1 RethrowConsumerErrorHandler (org.simpleflatmapper.map.error.RethrowConsumerErrorHandler)1 RethrowMapperBuilderErrorHandler (org.simpleflatmapper.map.error.RethrowMapperBuilderErrorHandler)1 AbstractMapperFactory (org.simpleflatmapper.map.mapper.AbstractMapperFactory)1 DbFinalObject (org.simpleflatmapper.test.beans.DbFinalObject)1 SampleFieldKey (org.simpleflatmapper.test.map.SampleFieldKey)1