Skip to content

Commit 2240bf4

Browse files
dreab8yrodiere
authored andcommitted
HHH-19072 Add test for issue
1 parent c9b08ea commit 2240bf4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
}

0 commit comments

Comments
 (0)