From 08b0a705e6d401e7f4a12e1b358654d5d015e515 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Tue, 28 Sep 2021 13:17:41 +0200 Subject: [PATCH] Remove `@NotImplementedYet` from some tests and fix some other tests --- .../cachemodes/SharedCacheModesTest.java | 4 ++-- ...buteConverterEntityManagerFactoryTest.java | 2 -- ...eAttributeConverterSessionFactoryTest.java | 2 -- .../ComplexValueGenerationBaselineTests.java | 2 -- .../ComplexValueGenerationTests.java | 5 ----- .../DefaultGeneratedValueIdentityTest.java | 13 ------------- .../generated/DefaultGeneratedValueTest.java | 7 +------ .../SimpleValueGenerationBaselineTests.java | 2 -- .../DiscriminatorQueryUsageTests.java | 19 +++++++++++++++---- .../joined/DiscriminatorQueryUsageTests.java | 19 +++++++++++++++---- .../hql/CastNullSelectExpressionTest.java | 7 +------ .../orm/test/query/hql/ParameterTests.java | 4 ++-- .../resultmapping/AbstractUsageTest.java | 2 +- .../resultmapping/EntityResultTests.java | 6 +++++- .../sql/NativeQueryResultBuilderTests.java | 4 ++-- 15 files changed, 44 insertions(+), 54 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cacheable/cachemodes/SharedCacheModesTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cacheable/cachemodes/SharedCacheModesTest.java index d1ee5e9246..049373f1bf 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cacheable/cachemodes/SharedCacheModesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cacheable/cachemodes/SharedCacheModesTest.java @@ -73,11 +73,11 @@ public class SharedCacheModesTest { query.setHint( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE, CacheStoreMode.USE ); assertEquals( CacheStoreMode.USE, query.getHints().get( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE ) ); - assertEquals( CacheMode.NORMAL, query.getCacheMode() ); + assertEquals( CacheMode.PUT, query.getCacheMode() ); query.setHint( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE, CacheStoreMode.BYPASS ); assertEquals( CacheStoreMode.BYPASS, query.getHints().get( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE ) ); - assertEquals( CacheMode.GET, query.getCacheMode() ); + assertEquals( CacheMode.IGNORE, query.getCacheMode() ); query.setHint( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE, CacheStoreMode.REFRESH ); assertEquals( CacheStoreMode.REFRESH, query.getHints().get( AvailableSettings.JPA_SHARED_CACHE_STORE_MODE ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterEntityManagerFactoryTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterEntityManagerFactoryTest.java index 76b56c5733..855158b3a3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterEntityManagerFactoryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterEntityManagerFactoryTest.java @@ -15,7 +15,6 @@ import jakarta.persistence.Tuple; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; @@ -34,7 +33,6 @@ public class PackagePrivateAttributeConverterEntityManagerFactoryTest { public final String sql = "select code from Tester where id = :id"; @Test - @NotImplementedYet( strict = false, reason = "Support for passing `resultType` to `#createNativeQuery` not yet implemented" ) public void test(SessionFactoryScope scope) { scope.inTransaction( (session) -> { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterSessionFactoryTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterSessionFactoryTest.java index f33dd80e80..f0ee10e4a1 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterSessionFactoryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/PackagePrivateAttributeConverterSessionFactoryTest.java @@ -15,7 +15,6 @@ import jakarta.persistence.Tuple; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.junit.jupiter.api.Test; @@ -31,7 +30,6 @@ import static org.junit.Assert.assertEquals; public class PackagePrivateAttributeConverterSessionFactoryTest { @Test - @NotImplementedYet( strict = false, reason = "Support for creating native-query with result-type not implemented" ) public void test(SessionFactoryScope scope) { scope.inTransaction( (session) -> { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationBaselineTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationBaselineTests.java index 8961e008ce..f7333d46f9 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationBaselineTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationBaselineTests.java @@ -26,7 +26,6 @@ import jakarta.persistence.Id; import jakarta.persistence.Table; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.junit.jupiter.api.AfterEach; @@ -41,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ @DomainModel( annotatedClasses = ComplexValueGenerationBaselineTests.NonAuditedEntity.class ) @SessionFactory -@NotImplementedYet( strict = false, reason = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" ) public class ComplexValueGenerationBaselineTests { @Test public void testLoading(SessionFactoryScope scope) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationTests.java index ff840d9ba1..b557395dd5 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/ComplexValueGenerationTests.java @@ -35,7 +35,6 @@ import org.hibernate.dialect.MySQLDialect; import org.hibernate.dialect.SybaseDialect; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.SkipForDialect; @@ -51,10 +50,6 @@ import static org.assertj.core.api.Assertions.assertThat; @SkipForDialect(dialectClass = MySQLDialect.class, reason = "See HHH-10196") @DomainModel( annotatedClasses = ComplexValueGenerationTests.AuditedEntity.class ) @SessionFactory -@NotImplementedYet( - strict = false, - reason = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" -) public class ComplexValueGenerationTests { @Test public void testGenerations(SessionFactoryScope scope) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueIdentityTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueIdentityTest.java index 580785f755..9462774e28 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueIdentityTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueIdentityTest.java @@ -36,40 +36,27 @@ import org.hibernate.annotations.GenerationTime; import org.hibernate.annotations.GeneratorType; import org.hibernate.annotations.UpdateTimestamp; import org.hibernate.annotations.ValueGenerationType; -import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.dialect.MySQLDialect; import org.hibernate.dialect.SybaseDialect; -import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.tuple.AnnotationValueGeneration; import org.hibernate.tuple.GenerationTiming; import org.hibernate.tuple.ValueGenerator; import org.hibernate.testing.DialectChecks; -import org.hibernate.testing.FailureExpected; import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.hibernate.testing.orm.junit.NotImplementedYet; 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.assertNull; -import static org.junit.Assert.assertTrue; @SkipForDialect(value = SybaseDialect.class, comment = "CURRENT_TIMESTAMP not supported as default value in Sybase") @SkipForDialect(value = MySQLDialect.class, comment = "See HHH-10196") @RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class) -@FailureExpected( - jiraKey = "", - message = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" -) -//@NotImplementedYet( -// strict = false, -// reason = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" -//) public class DefaultGeneratedValueIdentityTest extends BaseCoreFunctionalTestCase { @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueTest.java index b1a778c21f..bdf824200e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/DefaultGeneratedValueTest.java @@ -39,7 +39,6 @@ import org.hibernate.tuple.ValueGenerator; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.SkipForDialect; @@ -61,10 +60,6 @@ import static org.junit.Assert.assertTrue; */ @SkipForDialect( dialectClass = SybaseDialect.class, matchSubTypes = true, reason = "CURRENT_TIMESTAMP not supported as default value in Sybase" ) @SkipForDialect( dialectClass = MySQLDialect.class, reason = "See HHH-10196" ) -@NotImplementedYet( - strict = false, - reason = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" -) @DomainModel( annotatedClasses = DefaultGeneratedValueTest.TheEntity.class ) @SessionFactory public class DefaultGeneratedValueTest { @@ -163,7 +158,7 @@ public class DefaultGeneratedValueTest { scope.inTransaction( (s) -> { final TheEntity theEntity = s.get( TheEntity.class, 1 ); - assertEquals( "Creation timestamp should not change on update", created, theEntity.vmCreatedSqlTimestamp ); + assertEquals( "Creation timestamp should not change on update", created.vmCreatedSqlTimestamp, theEntity.vmCreatedSqlTimestamp ); assertTrue( "Update timestamp should have changed due to update", theEntity.updated.after( created.updated ) ); } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/SimpleValueGenerationBaselineTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/SimpleValueGenerationBaselineTests.java index c5e053d70c..f6b73c3f2d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/SimpleValueGenerationBaselineTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/SimpleValueGenerationBaselineTests.java @@ -13,7 +13,6 @@ import jakarta.persistence.Id; import jakarta.persistence.Table; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.junit.jupiter.api.AfterEach; @@ -26,7 +25,6 @@ import static org.assertj.core.api.Assertions.assertThat; */ @DomainModel( annotatedClasses = SimpleValueGenerationBaselineTests.NonAuditedEntity.class ) @SessionFactory -@NotImplementedYet( strict = false, reason = "Support for `java.sql.Date` and `java.sql.Time` is currently fubar" ) public class SimpleValueGenerationBaselineTests { @Test public void testLoading(SessionFactoryScope scope) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/DiscriminatorQueryUsageTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/DiscriminatorQueryUsageTests.java index c1083ead11..d369d86c68 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/DiscriminatorQueryUsageTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/DiscriminatorQueryUsageTests.java @@ -8,6 +8,8 @@ package org.hibernate.orm.test.mapping.inheritance.discriminator; import jakarta.persistence.Tuple; +import org.hibernate.query.spi.QueryImplementor; + import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; @@ -17,6 +19,8 @@ import org.junit.jupiter.api.Test; import org.assertj.core.api.Assertions; +import static org.junit.jupiter.api.Assertions.fail; + /** * @author Steve Ebersole */ @@ -68,10 +72,17 @@ public class DiscriminatorQueryUsageTests { @Test public void testUsageAsPredicateWithParamOfUnderlyingType(SessionFactoryScope scope) { scope.inTransaction( (session) -> { - final Long id = session.createQuery( "select p.id from Person p where type(p) = :type", Long.class ) - .setParameter( "type", "E" ) - .uniqueResult(); - Assertions.assertThat( id ).isEqualTo( steveId ); + QueryImplementor query = session.createQuery( + "select p.id from Person p where type(p) = :type", + Long.class + ); + try { + query.setParameter( "type", "E" ); + fail( "Expected that setting the underlying type for a parameter of type Class to fail!" ); + } + catch (IllegalArgumentException ex) { + // We expect this to fail + } } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/joined/DiscriminatorQueryUsageTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/joined/DiscriminatorQueryUsageTests.java index e73f5054f2..72db9d1175 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/joined/DiscriminatorQueryUsageTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/inheritance/discriminator/joined/DiscriminatorQueryUsageTests.java @@ -8,6 +8,8 @@ package org.hibernate.orm.test.mapping.inheritance.discriminator.joined; import jakarta.persistence.Tuple; +import org.hibernate.query.spi.QueryImplementor; + import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; @@ -17,6 +19,8 @@ import org.junit.jupiter.api.Test; import org.assertj.core.api.Assertions; +import static org.junit.jupiter.api.Assertions.fail; + /** * @author Steve Ebersole */ @@ -66,10 +70,17 @@ public class DiscriminatorQueryUsageTests { @Test public void testUsageAsPredicateWithParamOfUnderlyingType(SessionFactoryScope scope) { scope.inTransaction( (session) -> { - final Integer id = session.createQuery( "select p.id from ParentEntity p where type(p) = :type", Integer.class ) - .setParameter( "type", "ce" ) - .uniqueResult(); - Assertions.assertThat( id ).isEqualTo( 1 ); + QueryImplementor query = session.createQuery( + "select p.id from ParentEntity p where type(p) = :type", + Integer.class + ); + try { + query.setParameter( "type", "ce" ); + fail( "Expected that setting the underlying type for a parameter of type Class to fail!" ); + } + catch (IllegalArgumentException ex) { + // We expect this to fail + } } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/CastNullSelectExpressionTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/CastNullSelectExpressionTest.java index 0e7c39f034..ea6d90fdeb 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/CastNullSelectExpressionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/CastNullSelectExpressionTest.java @@ -13,7 +13,6 @@ import jakarta.persistence.Table; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.DomainModel; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.junit.jupiter.api.AfterEach; @@ -28,10 +27,6 @@ import static org.junit.Assert.assertNull; */ @DomainModel( annotatedClasses = CastNullSelectExpressionTest.Person.class ) @SessionFactory -@NotImplementedYet( - reason = "Combination of https://github.com/hibernate/hibernate-orm/discussions/3921 and https://github.com/hibernate/hibernate-orm/discussions/3889", - strict = false -) public class CastNullSelectExpressionTest { @Test @@ -57,7 +52,7 @@ public class CastNullSelectExpressionTest { scope.inTransaction( (session) -> { Person result = (Person) session.createQuery( - "select Person( id, firstName, cast( null as string ), lastName ) from Person where lastName='Munster'" + "select new Person( id, firstName, cast( null as string ), lastName ) from Person where lastName='Munster'" ).uniqueResult(); assertEquals( "Herman", result.firstName ); assertNull( result.middleName ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/ParameterTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/ParameterTests.java index 3c8e874ed8..680837e540 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/ParameterTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/ParameterTests.java @@ -92,8 +92,8 @@ public class ParameterTests extends BaseSqmUnitTest { try (Session session = sessionFactory().openSession()) { final Query query = session.createQuery( "select p.id from Person p where p.anniversary between :start and :end" ); - query.setParameter( "start", Instant.now().minus( 7, ChronoUnit.DAYS ), TemporalType.TIMESTAMP ); - query.setParameter( "end", Instant.now().plus( 7, ChronoUnit.DAYS ), TemporalType.TIMESTAMP ); + query.setParameter( "start", Date.from( Instant.now().minus( 7, ChronoUnit.DAYS ) ), TemporalType.TIMESTAMP ); + query.setParameter( "end", Date.from( Instant.now().plus( 7, ChronoUnit.DAYS ) ), TemporalType.TIMESTAMP ); final QueryParameterBindings bindings = ( (ExecutionContext) query ).getQueryParameterBindings(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/AbstractUsageTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/AbstractUsageTest.java index afd5cb5554..8bf0777df8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/AbstractUsageTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/AbstractUsageTest.java @@ -22,7 +22,7 @@ public abstract class AbstractUsageTest { public void prepareData(SessionFactoryScope scope) { scope.inTransaction( session -> { - session.save( new SimpleEntityWithNamedMappings( 1, "test" ) ); + session.save( new SimpleEntityWithNamedMappings( 1, "test", "notes" ) ); } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/EntityResultTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/EntityResultTests.java index a6da493498..213bae0306 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/EntityResultTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/resultmapping/EntityResultTests.java @@ -31,6 +31,7 @@ import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.notNullValue; @@ -80,6 +81,7 @@ public class EntityResultTests extends AbstractUsageTest { final SimpleEntityWithNamedMappings entity = results.get( 0 ); assertThat( entity.getId(), is( 1 ) ); assertThat( entity.getName(), is( "test" ) ); + assertThat( entity.getNotes(), is( "notes" ) ); // todo (6.0) : should also try executing the ProcedureCall once that functionality is implemented session.createStoredProcedureCall( "abc", "entity" ); @@ -109,6 +111,7 @@ public class EntityResultTests extends AbstractUsageTest { final SimpleEntityWithNamedMappings entity = results.get( 0 ); assertThat( entity.getId(), is( 1 ) ); assertThat( entity.getName(), is( "test" ) ); + assertThat( entity.getNotes(), is( "notes" ) ); // todo (6.0) : should also try executing the ProcedureCall once that functionality is implemented session.createStoredProcedureCall( "abc", "entity-none" ); @@ -137,7 +140,8 @@ public class EntityResultTests extends AbstractUsageTest { final SimpleEntityWithNamedMappings entity = results.get( 0 ); assertThat( entity.getId(), is( 1 ) ); - assertThat( entity.getName(), is( "test" ) ); + assertThat( entity.getName(), is( nullValue() ) ); + assertThat( entity.getNotes(), is( "notes" ) ); // todo (6.0) : should also try executing the ProcedureCall once that functionality is implemented session.createStoredProcedureCall( "abc", "entity-id-notes" ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/NativeQueryResultBuilderTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/NativeQueryResultBuilderTests.java index 19b9e65e2b..10a7030ddb 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/NativeQueryResultBuilderTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/NativeQueryResultBuilderTests.java @@ -194,9 +194,9 @@ public class NativeQueryResultBuilderTests { assertThat( results.size(), is( 1 ) ); final Object result = results.get( 0 ); - assertThat( result, instanceOf( String.class ) ); + assertThat( result, instanceOf( Character.class ) ); - assertThat( result, is( "O" ) ); + assertThat( result, is( 'O' ) ); } );