ソースを参照

Person Text domain tests

Andrew Grant 3 ヶ月 前
コミット
b78cfd3313

+ 1 - 1
src/main/java/scot/carricksoftware/grants/capitalisation/CapitaliseStringImpl.java

@@ -18,7 +18,7 @@ public class CapitaliseStringImpl implements CapitaliseString {
 
     @Override
     public String capitalise(String input) {
-        logger.info("CapitaliseStringImpl::capitalise");
+        logger.debug("CapitaliseStringImpl::capitalise");
         StringBuilder result = new StringBuilder();
         boolean newWord = true;
         if (input != null && input.length() > 2) {

+ 2 - 2
src/main/java/scot/carricksoftware/grants/services/census/censusentry/UpdateRecordedYearOfBirthImpl.java

@@ -44,7 +44,7 @@ public class UpdateRecordedYearOfBirthImpl implements UpdateRecordedYearOfBirth
                     Integer age = Integer.valueOf(censusEntryCommand.getAge());
                     updateDate(person, String.valueOf(year - age));
                 } catch (NumberFormatException e) {
-                    logger.info(" -- Age cannot be parsed");
+                    logger.debug(" -- Age cannot be parsed");
                 }
             } else {
                 PersonCommand personCommand = personConverter.convert(person);
@@ -63,7 +63,7 @@ public class UpdateRecordedYearOfBirthImpl implements UpdateRecordedYearOfBirth
             personCommand.setRecordedYearOfBirth(dateString);
             personService.savePersonCommand(personCommand);
         } else {
-            logger.info(" -- Person Command is null.");
+            logger.debug(" -- Person Command is null.");
         }
     }
 

+ 1 - 1
src/main/java/scot/carricksoftware/grants/services/certificates/birthcertificates/UpdateCertifiedYearOfBirthImpl.java

@@ -58,7 +58,7 @@ public class UpdateCertifiedYearOfBirthImpl implements UpdateCertifiedYearOfBirt
     }
 
     private void logNoCommandError() {
-        logger.info("PersonCommand = null.");
+        logger.debug("PersonCommand = null.");
     }
 
 

+ 1 - 1
src/main/java/scot/carricksoftware/grants/services/certificates/deathcertificates/UpdateCertifiedYearOfDeathImpl.java

@@ -58,7 +58,7 @@ public class UpdateCertifiedYearOfDeathImpl implements UpdateCertifiedYearOfDeat
     }
 
     private void logNoCommandError() {
-        logger.info("PersonCommand = null.");
+        logger.debug("PersonCommand = null.");
     }
 
 }

+ 1 - 1
src/main/java/scot/carricksoftware/grants/validators/certificates/divorcecertificate/DivorceCertificateCommandDatesValidatorImpl.java

@@ -27,7 +27,7 @@ public class DivorceCertificateCommandDatesValidatorImpl implements DivorceCerti
 
     @Override
     public void validate(DivorceCertificateCommand divorceCertificateCommand, BindingResult bindingResult) {
-        logger.info("DivorceCertificateCommandPeopleValidator::validate");
+        logger.debug("DivorceCertificateCommandPeopleValidator::validate");
         validateFirstPartyDate(divorceCertificateCommand, bindingResult);
         validateSecondPartyDate(divorceCertificateCommand, bindingResult);
         validateRegisteredDate(divorceCertificateCommand, bindingResult);

+ 1 - 1
src/main/java/scot/carricksoftware/grants/validators/certificates/divorcecertificate/DivorceCertificateCommandPeopleValidatorImpl.java

@@ -32,7 +32,7 @@ public class DivorceCertificateCommandPeopleValidatorImpl implements DivorceCert
 
     @Override
     public void validate(DivorceCertificateCommand divorceCertificateCommand, BindingResult bindingResult) {
-        logger.info("DivorceCertificateCommandPeopleValidator::validate");
+        logger.debug("DivorceCertificateCommandPeopleValidator::validate");
         validateFirstParty(divorceCertificateCommand, bindingResult);
         validateSecondParty(divorceCertificateCommand, bindingResult);
         validateDifferentParties(divorceCertificateCommand, bindingResult);

+ 1 - 1
src/main/java/scot/carricksoftware/grants/validators/certificates/divorcecertificate/DivorceCertificateCommandValidatorImpl.java

@@ -30,7 +30,7 @@ public class DivorceCertificateCommandValidatorImpl implements DivorceCertificat
 
     @Override
     public void validate(DivorceCertificateCommand divorceCertificateCommand, BindingResult bindingResult) {
-        logger.info("DivorceCertificateCommandValidator::validate");
+        logger.debug("DivorceCertificateCommandValidator::validate");
         divorceCertificateCommandPeopleValidator.validate(divorceCertificateCommand, bindingResult);
         divorceCertificateCommandDatesValidator.validate(divorceCertificateCommand, bindingResult);
     }

+ 50 - 0
src/test/java/scot/carricksoftware/grants/domains/text/PersonTextTest.java

@@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.domains.people.Person;
 
 import static org.junit.jupiter.api.Assertions.*;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 
@@ -48,4 +49,53 @@ class PersonTextTest {
         assertEquals(person, personText.getPerson());
     }
 
+    @Test
+    void getLevelTest() {
+        assertNull(personText.getLevel());
+    }
+
+    @Test
+    void setLevelTest() {
+        Long level = GetRandomLong();
+        personText.setLevel(level);
+        assertEquals(level, personText.getLevel());
+    }
+
+    @Test
+    void getOrderTest() {
+        assertNull(personText.getOrder());
+    }
+
+    @Test
+    void setOrderTest() {
+        Long order = GetRandomLong();
+        personText.setOrder(order);
+        assertEquals(order, personText.getOrder());
+    }
+
+    @Test
+    void getHeadingTest() {
+        assertNull(personText.getHeading());
+    }
+
+    @Test
+    void setHeadingTest() {
+        String heading = GetRandomString();
+        personText.setHeading(heading);
+        assertEquals(heading, personText.getHeading());
+    }
+
+    @Test
+    void getContentTest() {
+        assertNull(personText.getContent());
+    }
+
+    @Test
+    void setContentTest() {
+        String content = GetRandomString();
+        personText.setContent(content);
+        assertEquals(content, personText.getContent());
+    }
+
+
 }