METAGEN-79 TestUtil#getFieldFromMetamodelFor() used now Class.getDeclaredField() to only access fields defined in the actual class
This commit is contained in:
parent
2d245a3798
commit
4ac9cbfdb3
|
@ -42,10 +42,16 @@ public class InheritanceTest extends CompilationTest {
|
|||
|
||||
// METAGEN-29
|
||||
assertSuperClassRelationShipInMetamodel( Person.class, AbstractEntity.class );
|
||||
assertPresenceOfFieldInMetamodelFor( AbstractEntity.class, "id", "Property 'id' should exist" );
|
||||
assertPresenceOfFieldInMetamodelFor( AbstractEntity.class, "foo", "Property should exist - METAGEN-29" );
|
||||
assertAttributeTypeInMetaModelFor(
|
||||
AbstractEntity.class, "foo", Object.class, "Object is the upper bound of foo "
|
||||
AbstractEntity.class,
|
||||
"foo",
|
||||
Object.class,
|
||||
"Object is the upper bound of foo "
|
||||
);
|
||||
|
||||
assertPresenceOfFieldInMetamodelFor( Person.class, "name", "Property 'name' should exist" );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -211,7 +211,7 @@ public class TestUtil {
|
|||
Class<?> metaModelClass = getMetamodelClassFor( entityClass );
|
||||
Field field;
|
||||
try {
|
||||
field = metaModelClass.getField( fieldName );
|
||||
field = metaModelClass.getDeclaredField( fieldName );
|
||||
}
|
||||
catch ( NoSuchFieldException e ) {
|
||||
field = null;
|
||||
|
|
Loading…
Reference in New Issue