diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.java index abf8de8512..b4a53aa130 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.java @@ -12,6 +12,7 @@ import org.junit.Test; import org.hibernate.QueryException; import org.hibernate.Session; +import org.hibernate.envers.exception.AuditException; import org.hibernate.envers.query.AuditEntity; import org.hibernate.envers.test.BaseEnversFunctionalTestCase; import org.hibernate.envers.test.Priority; @@ -290,15 +291,14 @@ public class AuditedDynamicComponentsAdvancedCasesTest extends BaseEnversFunctio getAuditReader().createQuery() .forEntitiesAtRevision( AdvancedEntity.class, 1 ) .add( - AuditEntity.property( "dynamicConfiguration_" + INTERNAL_LIST ) - .eq( entity.getDynamicConfiguration().get( INTERNAL_LIST ) ) + AuditEntity.property( "dynamicConfiguration_" + INTERNAL_MAP_WITH_MANY_TO_MANY ) + .eq( entity.getDynamicConfiguration().get( INTERNAL_MAP_WITH_MANY_TO_MANY ) ) ) .getResultList(); Assert.fail(); } - catch ( QueryException e ) { - e.printStackTrace(); - + catch ( AuditException e ) { + Assert.assertEquals( "This type of relation (org.hibernate.envers.test.integration.components.dynamic.AdvancedEntity.dynamicConfiguration_internalMapWithEntities) isn't supported and can't be used in queries." , e.getMessage()); } catch ( Exception e ) { Assert.fail(); diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/SanityCheckTest.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/SanityCheckTest.java index 1caf46c0cb..b7c6fb2511 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/SanityCheckTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/components/dynamic/SanityCheckTest.java @@ -111,6 +111,7 @@ public class SanityCheckTest extends BaseEnversFunctionalTestCase { Assert.fail(); } catch ( AuditException e ) { + Assert.assertEquals( "This type of relation (org.hibernate.envers.test.integration.components.dynamic.PlainEntity.component_manyToManyList) isn't supported and can't be used in queries." , e.getMessage()); } catch ( Exception e ) { Assert.fail(); @@ -142,10 +143,8 @@ public class SanityCheckTest extends BaseEnversFunctionalTestCase { Assert.fail(); } catch ( QueryException e ) { - e.printStackTrace(); } catch ( Exception e ) { - e.printStackTrace(); Assert.fail(); } }