@Test
public void verifyUniqueFieldsAreSkippedOnReflectionError()
{

    Schema schema = createSchema( DummyDataElement.class, "dummyDataElement",
        Stream.of(
            createUniqueProperty( String.class, "url", true, true ),
            createUniqueProperty( String.class, "code", true, true )).collect(toList())
    );
    mockSession( "SELECT code,url from " + schema.getKlass().getSimpleName() );
    List<Object[]> l = new ArrayList();
    l.add( new Object[] { "abc", "http://ok" } );
    l.add( new Object[] { "bce", "http://-exception" } );
    l.add( new Object[] { "def", "http://also-ok" } );
    when( query.getResultList() ).thenReturn( l );
    List<DataElement> result = (List<DataElement>) subject.fetch( schema );
    assertThat( result, hasSize( 2 ) );
    assertThat( result, IsIterableContainingInAnyOrder.containsInAnyOrder(
        allOf(
                hasProperty( "code", is( "def" ) ),
                hasProperty( "url", is( "http://also-ok" ) )
        ),
        allOf(
                hasProperty( "code", is( "abc" ) ),
                hasProperty( "url", is( "http://ok" ) )
        )
    ) );
}