test showing selecting enum value causes NPE
This commit is contained in:
parent
9e7a091d67
commit
53d38262ba
|
@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.is;
|
|||
*/
|
||||
@SuppressWarnings({"deprecation","WeakerAccess"})
|
||||
@ServiceRegistry
|
||||
@DomainModel( standardModels = StandardDomainModel.GAMBIT )
|
||||
@DomainModel( standardModels = {StandardDomainModel.GAMBIT, StandardDomainModel.ANIMAL} )
|
||||
@SessionFactory
|
||||
public class LiteralTests {
|
||||
|
||||
|
@ -265,4 +265,19 @@ public class LiteralTests {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnums(SessionFactoryScope scope) {
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
session.createQuery( "from Zoo where classification=COOL" ).getResultList();
|
||||
session.createQuery( "from Zoo where classification=org.hibernate.testing.orm.domain.animal.Classification.COOL" ).getResultList();
|
||||
|
||||
assertThat( session.createQuery( "select org.hibernate.testing.orm.domain.animal.Classification.LAME" )
|
||||
.getSingleResult(), is( org.hibernate.testing.orm.domain.animal.Classification.LAME ) );
|
||||
assertThat( session.createQuery( "select org.hibernate.testing.orm.domain.gambit.EntityOfBasics$Gender.MALE" )
|
||||
.getSingleResult(), is( org.hibernate.testing.orm.domain.gambit.EntityOfBasics.Gender.MALE ) );
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue