From 47d0b1265fdebbaccc1f0eb5d863b48a8b9f2b2b Mon Sep 17 00:00:00 2001 From: Gavin King Date: Mon, 13 Sep 2021 09:22:48 +0200 Subject: [PATCH] improve the test for tenant ids --- .../test/java/org/hibernate/test/tenantid/TenantIdTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/test/tenantid/TenantIdTest.java b/hibernate-core/src/test/java/org/hibernate/test/tenantid/TenantIdTest.java index 22f2db2572..74d6dbba42 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/tenantid/TenantIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/tenantid/TenantIdTest.java @@ -17,6 +17,7 @@ import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryProducer; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.Setting; +import org.hibernate.tuple.TenantIdBinder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; @@ -78,6 +79,9 @@ public class TenantIdTest implements SessionFactoryProducer { scope.inTransaction( session -> { assertNull( session.find(Account.class, acc.id) ); assertEquals( 0, session.createQuery("from Account").getResultList().size() ); + session.disableFilter(TenantIdBinder.FILTER_NAME); + assertNotNull( session.find(Account.class, acc.id) ); + assertEquals( 1, session.createQuery("from Account").getResultList().size() ); } ); }