diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/DeviceRepository.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/DeviceRepository.java new file mode 100644 index 00000000..74006a17 --- /dev/null +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/DeviceRepository.java @@ -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 { +} diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/package-info.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/package-info.java new file mode 100644 index 00000000..886bf483 --- /dev/null +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/repository/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains class structures for the interface and base CRUD operations for hibernate. + */ +package hirs.attestationca.repository; diff --git a/HIRS_Utils/src/test/java/hirs/data/persist/SpringPersistenceTest.java b/HIRS_Utils/src/test/java/hirs/data/persist/SpringPersistenceTest.java new file mode 100644 index 00000000..f423aa8f --- /dev/null +++ b/HIRS_Utils/src/test/java/hirs/data/persist/SpringPersistenceTest.java @@ -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; +}