File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/internal Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-License-Identifier: LGPL-2.1-or-later
3+ * Copyright Red Hat Inc. and Hibernate Authors
4+ */
5+ package org .hibernate .orm .test .internal ;
6+
7+ import org .assertj .core .api .Assertions ;
8+ import org .hibernate .SessionFactory ;
9+ import org .hibernate .cfg .AvailableSettings ;
10+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
11+ import org .hibernate .testing .orm .junit .JiraKey ;
12+ import org .hibernate .testing .orm .junit .Jpa ;
13+ import org .hibernate .testing .orm .junit .Setting ;
14+ import org .junit .jupiter .api .Test ;
15+
16+ import static org .assertj .core .api .AssertionsForInterfaceTypes .assertThat ;
17+ import static org .hibernate .orm .test .internal .SessionFactoryNameSettingTest .SESSION_FACTORY_NAME ;
18+
19+ @ Jpa (
20+ integrationSettings = @ Setting (name = AvailableSettings .SESSION_FACTORY_NAME , value = SESSION_FACTORY_NAME )
21+ )
22+ @ JiraKey ("HHH-19072" )
23+ public class SessionFactoryNameSettingTest {
24+ public static final String SESSION_FACTORY_NAME = "TEST_SESSION_FACTORY" ;
25+
26+ @ Test
27+ public void testSessionFactoryNameSettingInfluencingSessionFactoryName (EntityManagerFactoryScope scope ) {
28+ assertThat ( scope .getEntityManagerFactory ().unwrap ( SessionFactory .class ).getName () )
29+ .isEqualTo ( SESSION_FACTORY_NAME );
30+ }
31+
32+ @ Test
33+ public void testSessionFactoryNameSettingInfluencingSessionFactoryJndiName (EntityManagerFactoryScope scope ) {
34+ Assertions .assertThat ( scope .getEntityManagerFactory ().unwrap ( SessionFactory .class ).getJndiName () )
35+ .isEqualTo ( SESSION_FACTORY_NAME );
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments