diff options
Diffstat (limited to 'src/test/java/ru/mrfoxygmfr')
-rw-r--r-- | src/test/java/ru/mrfoxygmfr/warehouse_accounting/db/config/HibernateConfigTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/ru/mrfoxygmfr/warehouse_accounting/db/config/HibernateConfigTest.java b/src/test/java/ru/mrfoxygmfr/warehouse_accounting/db/config/HibernateConfigTest.java new file mode 100644 index 0000000..0fba515 --- /dev/null +++ b/src/test/java/ru/mrfoxygmfr/warehouse_accounting/db/config/HibernateConfigTest.java @@ -0,0 +1,26 @@ +package ru.mrfoxygmfr.warehouse_accounting.db.config; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.orm.hibernate5.LocalSessionFactoryBean; +import org.springframework.test.context.TestPropertySource; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@SpringBootTest +@TestPropertySource(locations="classpath:application.properties") +class HibernateConfigTest { + @Autowired + private LocalSessionFactoryBean sessionFactory; + + @Test + public void test() { + SessionFactory sessionFactoryObject = sessionFactory.getObject(); + assertNotNull(sessionFactoryObject); + Session session = sessionFactoryObject.openSession(); + assertNotNull(session); + } +}
\ No newline at end of file |