Kaynağa Gözat

AddAtrribute Class renamed

Andrew Grant 3 ay önce
ebeveyn
işleme
de3c5926cb

+ 1 - 1
src/main/java/scot/carricksoftware/grants/controllers/AddAttribute.java → src/main/java/scot/carricksoftware/grants/controllers/AddAttributes.java

@@ -7,6 +7,6 @@ package scot.carricksoftware.grants.controllers;
 
 import org.springframework.ui.Model;
 
-public interface AddAttribute {
+public interface AddAttributes {
     void AddDeathCertificate(Model model);
 }

+ 4 - 2
src/main/java/scot/carricksoftware/grants/controllers/AddAttributeImpl.java → src/main/java/scot/carricksoftware/grants/controllers/AddAttributesImpl.java

@@ -5,6 +5,7 @@
 
 package scot.carricksoftware.grants.controllers;
 
+import org.springframework.stereotype.Component;
 import org.springframework.ui.Model;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
 import scot.carricksoftware.grants.constants.AttributeConstants;
@@ -12,13 +13,14 @@ import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
 import scot.carricksoftware.grants.services.places.places.PlaceService;
 
-public class AddAttributeImpl implements AddAttribute {
+@Component
+public class AddAttributesImpl implements AddAttributes {
 
     private final PersonService personService;
     private final PlaceService placeService;
     private final OrganisationService organisationService;
 
-    public AddAttributeImpl(PersonService personService, PlaceService placeService, OrganisationService organisationService) {
+    public AddAttributesImpl(PersonService personService, PlaceService placeService, OrganisationService organisationService) {
         this.personService = personService;
         this.placeService = placeService;
         this.organisationService = organisationService;

+ 4 - 1
src/main/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerImpl.java

@@ -22,6 +22,7 @@ import scot.carricksoftware.grants.constants.AttributeConstants;
 import scot.carricksoftware.grants.constants.CertificateMappingConstants;
 import scot.carricksoftware.grants.constants.MappingConstants;
 import scot.carricksoftware.grants.constants.ViewConstants;
+import scot.carricksoftware.grants.controllers.AddAttributes;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateCommandConverter;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverter;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
@@ -46,6 +47,7 @@ public class DeathCertificateFormControllerImpl implements DeathCertificateFormC
     private final OrganisationService organisationService;
     private final CapitaliseDeathCertificate capitaliseDeathCertificate;
     private final UpdateCertifiedYearOfDeath updateCertifiedYearOfDeath;
+    private final AddAttributes addAttributes;
 
 
     public DeathCertificateFormControllerImpl(DeathCertificateService deathCertificateService,
@@ -56,7 +58,7 @@ public class DeathCertificateFormControllerImpl implements DeathCertificateFormC
                                               PlaceService placeService,
                                               OrganisationService organisationService,
                                               CapitaliseDeathCertificate capitaliseDeathCertificate,
-                                              UpdateCertifiedYearOfDeath updateCertifiedYearOfDeath) {
+                                              UpdateCertifiedYearOfDeath updateCertifiedYearOfDeath, AddAttributes addAttributes) {
         this.deathCertificateService = deathCertificateService;
         this.deathCertificateCommandConverter = deathCertificateCommandConverter;
 
@@ -69,6 +71,7 @@ public class DeathCertificateFormControllerImpl implements DeathCertificateFormC
         this.organisationService = organisationService;
         this.capitaliseDeathCertificate = capitaliseDeathCertificate;
         this.updateCertifiedYearOfDeath = updateCertifiedYearOfDeath;
+        this.addAttributes = addAttributes;
     }
 
     @SuppressWarnings("SameReturnValue")

+ 1 - 1
src/test/java/scot/carricksoftware/grants/controllers/AddAttributeTest.java → src/test/java/scot/carricksoftware/grants/controllers/AddAttributesTest.java

@@ -7,7 +7,7 @@ package scot.carricksoftware.grants.controllers;
 
 import org.junit.jupiter.api.BeforeEach;
 
-class AddAttributeTest {
+class AddAttributesTest {
 
     @BeforeEach
     void setUp() {

+ 6 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerSaveOrUpdateTest.java

@@ -15,6 +15,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.capitalisation.certificates.deathcertificates.CapitaliseDeathCertificate;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+import scot.carricksoftware.grants.controllers.AddAttributes;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateCommandConverterImpl;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverterImpl;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
@@ -66,6 +67,9 @@ public class DeathCertificateFormControllerSaveOrUpdateTest {
     @Mock
     CapitaliseDeathCertificate capitaliseDeathCertificateMock;
 
+    @Mock
+    AddAttributes addAttributesMock;
+
     @Mock
     private DeathCertificateCommandValidator deathCertificateCommandValidatorMock;
 
@@ -82,7 +86,8 @@ public class DeathCertificateFormControllerSaveOrUpdateTest {
                 placeServiceMock,
                 organisationServiceMock,
                 capitaliseDeathCertificateMock,
-                updateCertifiedYearOfDeathMock);
+                updateCertifiedYearOfDeathMock,
+                addAttributesMock);
         deathCertificateCommand = new DeathCertificateCommandImpl();
     }
 

+ 6 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerTest.java

@@ -16,6 +16,7 @@ import org.springframework.ui.Model;
 import scot.carricksoftware.grants.capitalisation.certificates.deathcertificates.CapitaliseDeathCertificate;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
 import scot.carricksoftware.grants.constants.AttributeConstants;
+import scot.carricksoftware.grants.controllers.AddAttributes;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateCommandConverterImpl;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverterImpl;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
@@ -70,6 +71,9 @@ public class DeathCertificateFormControllerTest {
     @Mock
     private UpdateCertifiedYearOfDeath updateCertifiedYearOfDeathMock;
 
+    @Mock
+    private AddAttributes addAttributesMock;
+
 
     @BeforeEach
     public void setUp() {
@@ -81,7 +85,8 @@ public class DeathCertificateFormControllerTest {
                 placeServiceMock,
                 organisationServiceMock,
                 capitaliseDeathCertificateMock,
-                updateCertifiedYearOfDeathMock);
+                updateCertifiedYearOfDeathMock,
+                addAttributesMock);
     }
 
     @Test

+ 6 - 1
src/test/java/scot/carricksoftware/grants/controllers/certificates/deathcertificates/DeathCertificateFormControllerValidationTest.java

@@ -16,6 +16,7 @@ import org.springframework.validation.BindingResult;
 import scot.carricksoftware.grants.capitalisation.certificates.deathcertificates.CapitaliseDeathCertificate;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+import scot.carricksoftware.grants.controllers.AddAttributes;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateCommandConverter;
 import scot.carricksoftware.grants.converters.certificates.deathcertificates.DeathCertificateConverter;
 import scot.carricksoftware.grants.services.certificates.deathcertificates.DeathCertificateService;
@@ -67,6 +68,9 @@ public class DeathCertificateFormControllerValidationTest {
     @Mock
     private UpdateCertifiedYearOfDeath updateCertifiedYearOfDeathMock;
 
+    @Mock
+    private AddAttributes addAttributesMock;
+
     @Mock
     CapitaliseDeathCertificate capitaliseDeathCertificateMock;
 
@@ -81,7 +85,8 @@ public class DeathCertificateFormControllerValidationTest {
                 placeServiceMock,
                 organisationServiceMock,
                 capitaliseDeathCertificateMock,
-                updateCertifiedYearOfDeathMock);
+                updateCertifiedYearOfDeathMock,
+                addAttributesMock);
     }