From f17513f8c5b96c2f12d8085a1992f1391cb78535 Mon Sep 17 00:00:00 2001 From: Jonathan Bregler Date: Wed, 2 May 2018 13:02:18 +0200 Subject: [PATCH] HHH-12362 - Allow both SQL query hints and comments - org.hibernate.test.queryhint.QueryHintTest uses assertNotNull(String#contains(String)) which always evaluates to true --- .../org/hibernate/test/queryhint/QueryHintTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/queryhint/QueryHintTest.java b/hibernate-core/src/test/java/org/hibernate/test/queryhint/QueryHintTest.java index dcd7120e95..c4ab0767b7 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/queryhint/QueryHintTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/queryhint/QueryHintTest.java @@ -29,7 +29,7 @@ import org.junit.Test; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author Brett Meyer @@ -100,7 +100,7 @@ public class QueryHintTest extends BaseNonConfigCoreFunctionalTestCase { 1, connectionProvider.getPreparedStatements().size() ); - assertNotNull( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); + assertTrue( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); connectionProvider.clear(); // test multiple hints @@ -118,7 +118,7 @@ public class QueryHintTest extends BaseNonConfigCoreFunctionalTestCase { 1, connectionProvider.getPreparedStatements().size() ); - assertNotNull( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS, USE_CONCAT */" ) ); + assertTrue( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS, USE_CONCAT */" ) ); connectionProvider.clear(); // ensure the insertion logic can handle a comment appended to the front @@ -136,7 +136,7 @@ public class QueryHintTest extends BaseNonConfigCoreFunctionalTestCase { 1, connectionProvider.getPreparedStatements().size() ); - assertNotNull( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); + assertTrue( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); connectionProvider.clear(); // test Criteria @@ -153,7 +153,7 @@ public class QueryHintTest extends BaseNonConfigCoreFunctionalTestCase { 1, connectionProvider.getPreparedStatements().size() ); - assertNotNull( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); + assertTrue( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "select /*+ ALL_ROWS */" ) ); connectionProvider.clear(); } @@ -176,7 +176,7 @@ public class QueryHintTest extends BaseNonConfigCoreFunctionalTestCase { 1, connectionProvider.getPreparedStatements().size() ); - assertNotNull( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "/* My_Query */ select /*+ ALL_ROWS */" ) ); + assertTrue( connectionProvider.getPreparedSQLStatements().get( 0 ).contains( "/* My_Query */ select /*+ ALL_ROWS */" ) ); connectionProvider.clear(); }