Prechádzať zdrojové kódy

BaseCertificate Class

Andrew Grant 6 mesiacov pred
rodič
commit
879117b0ac

+ 4 - 0
scripts/create_uat.txt

@@ -4,6 +4,7 @@ CREATE DATABASE grants_uat;
 #Create database service accounts
 CREATE USER 'grants_uat_user'@'%' IDENTIFIED BY 'abigail';
 CREATE USER 'apg'@'%' IDENTIFIED BY <suzanne>;
+CREATE USER 'grants_uat_readonly'@'%' IDENTIFIED BY 'martha';
 
 
 #Database grants
@@ -12,4 +13,7 @@ GRANT SELECT ON grants_uat.* to 'grants_uat_user'@'%';
 GRANT INSERT ON grants_uat.* to 'grants_uat_user'@'%';
 GRANT DELETE ON grants_uat.* to 'grants_uat_user'@'%';
 GRANT UPDATE ON grants_uat.* to 'grants_uat_user'@'%';
+
+
+GRANT SELECT ON grants_uat.* to 'grants_uat_readonly'@'%';
 FLUSH PRIVILEGES;

+ 13 - 0
src/main/java/scot/carricksoftware/grants/domains/certificates/BaseCertificate.java

@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.domains.certificates;
+
+import jakarta.persistence.MappedSuperclass;
+import scot.carricksoftware.grants.BaseEntity;
+
+@MappedSuperclass
+public class BaseCertificate extends BaseEntity {
+}

+ 1 - 2
src/main/java/scot/carricksoftware/grants/domains/certificates/BirthCertificate.java

@@ -6,11 +6,10 @@
 package scot.carricksoftware.grants.domains.certificates;
 
 import jakarta.persistence.*;
-import scot.carricksoftware.grants.BaseEntity;
 import scot.carricksoftware.grants.domains.people.Person;
 
 @Entity
-public class BirthCertificate extends BaseEntity {
+public class BirthCertificate extends BaseCertificate {
 
     @SuppressWarnings("JpaDataSourceORMInspection")
     @ManyToOne()

+ 1 - 1
src/main/resources/application.properties

@@ -2,7 +2,7 @@ spring.application.name=grants
 server.port=8086
 server.servlet.context-path=/grants
 spring.mvc.format.date=dd-MM-yyyy
-spring.profiles.active=uat
+spring.profiles.active=dev
 logging.level.scot.carricksoftware=trace
 
 

+ 28 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/BaseCertificateTest.java

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.domains.certificates;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+class BaseCertificateTest {
+
+    private BaseCertificate certificate;
+
+    @BeforeEach
+    void setUp() {
+        certificate = new BaseCertificate();
+    }
+
+    @Test
+    void dummyTest(){
+        assertNotNull(certificate);
+    }
+
+}