Reloaded the unit test

This commit is contained in:
Cyrus 2022-07-28 07:41:54 -04:00
parent 53c565717d
commit 5ec4d8e415
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package hirs.attestationca.repository;
import org.springframework.stereotype.Repository;
//import org.springframework.data.jpa.respository.JpaRepository;
/**
* Setting up for new creation for CRUD operations.
*/
@Repository
public interface DeviceRepository { // extends JpaRepository<Device, UUID> {
}

View File

@ -0,0 +1,4 @@
/**
* Contains class structures for the interface and base CRUD operations for hibernate.
*/
package hirs.attestationca.repository;

View File

@ -0,0 +1,23 @@
package hirs.data.persist;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
/**
* Base class that autowires a session factory for use of
* any tests that need a database connection.
*/
@ContextConfiguration(classes = PersistenceConfiguration.class)
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class SpringPersistenceTest extends AbstractTestNGSpringContextTests {
/**
* Autowired session factory.
*/
@SuppressWarnings("checkstyle:visibilitymodifier")
@Autowired
protected SessionFactory sessionFactory;
}