From cd20587830c9c6d5654251d4feddd9a054b535da Mon Sep 17 00:00:00 2001 From: arybakov Date: Fri, 5 Jan 2024 09:30:01 -0700 Subject: [PATCH 1/2] GRAD2-1704 Rename column in API Student Graduation TRANSCRIPT_MESSAGE --- .../api/gradalgorithm/dto/TranscriptMessage.java | 7 +++---- .../service/GradAlgorithmService.java | 6 ++++-- .../service/GradAlgorithmServiceTests.java | 14 ++++++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/dto/TranscriptMessage.java b/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/dto/TranscriptMessage.java index ffc58f3f..e4945d60 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/dto/TranscriptMessage.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/dto/TranscriptMessage.java @@ -1,10 +1,9 @@ package ca.bc.gov.educ.api.gradalgorithm.dto; -import java.util.UUID; - +import lombok.Data; import org.springframework.stereotype.Component; -import lombok.Data; +import java.util.UUID; @Data @Component @@ -17,7 +16,7 @@ public class TranscriptMessage { private String gradDateMessage; private String honourNote; private String adIBProgramMessage; - private String programCadre; + private String frenchImmersionMessage; private String careerProgramMessage; private String gradProjectedMessage; private String honourProjectedNote; diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmService.java b/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmService.java index fed82c2e..4ff65940 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmService.java @@ -4,7 +4,9 @@ import ca.bc.gov.educ.api.gradalgorithm.service.caching.GradProgramService; import ca.bc.gov.educ.api.gradalgorithm.service.caching.GradSchoolService; import ca.bc.gov.educ.api.gradalgorithm.service.caching.StudentGraduationService; -import ca.bc.gov.educ.api.gradalgorithm.util.*; +import ca.bc.gov.educ.api.gradalgorithm.util.APIUtils; +import ca.bc.gov.educ.api.gradalgorithm.util.GradAlgorithmApiUtils; +import ca.bc.gov.educ.api.gradalgorithm.util.JsonTransformer; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.tuple.Pair; @@ -819,7 +821,7 @@ private void createCompleteGradMessage(StringBuilder currentGradMessage, Transcr } if(!optPrograms.isEmpty() && opMessage.equalsIgnoreCase(GRADUATED)) { - currentGradMessage.append(String.format(result.getProgramCadre(),String.join(",", optPrograms))); + currentGradMessage.append(String.format(result.getFrenchImmersionMessage(),String.join(",", optPrograms))); appendPeriod(currentGradMessage); } if(ruleProcessorData.getGradProgram().getProgramCode().contains("-PF") && dualDogwoodGraduated && opMessage.equalsIgnoreCase(GRADUATED)) { diff --git a/api/src/test/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmServiceTests.java b/api/src/test/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmServiceTests.java index a3629271..cdf386cc 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmServiceTests.java +++ b/api/src/test/java/ca/bc/gov/educ/api/gradalgorithm/service/GradAlgorithmServiceTests.java @@ -1,7 +1,6 @@ package ca.bc.gov.educ.api.gradalgorithm.service; -import static org.junit.Assert.assertNotNull; -import java.util.*; +import ca.bc.gov.educ.api.gradalgorithm.EducGradAlgorithmTestBase; import ca.bc.gov.educ.api.gradalgorithm.dto.*; import ca.bc.gov.educ.api.gradalgorithm.service.caching.GradProgramService; import ca.bc.gov.educ.api.gradalgorithm.service.caching.GradSchoolService; @@ -14,9 +13,12 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; -import ca.bc.gov.educ.api.gradalgorithm.EducGradAlgorithmTestBase; import reactor.core.publisher.Mono; +import java.util.*; + +import static org.junit.Assert.assertNotNull; + @RunWith(SpringRunner.class) @SpringBootTest @ActiveProfiles("test") @@ -608,7 +610,7 @@ public void testGraduateStudent_projected() throws Exception { msg.setGradMainMessage("ASdasdad"); msg.setHonourNote("asda"); msg.setMessageTypeCode(msgType); - msg.setProgramCadre("Adasd"); + msg.setFrenchImmersionMessage("Adasd"); msg.setProgramCode(gradProgram); msg.setTranscriptMessageID(new UUID(1, 1)); msg.setGradProjectedMessage("asdadad"); @@ -666,7 +668,7 @@ public void testGraduateStudent_projected_SCCP() throws Exception { msg.setGradMainMessage("ASdasdad"); msg.setHonourNote("asda"); msg.setMessageTypeCode(msgType); - msg.setProgramCadre("Adasd"); + msg.setFrenchImmersionMessage("Adasd"); msg.setGradProjectedMessage("sdada"); msg.setProgramCode(gradProgram); msg.setTranscriptMessageID(new UUID(1, 1)); @@ -729,7 +731,7 @@ public void testGraduateStudent_projected_SCCP_withFutureDate() throws Exception msg.setGradMainMessage("ASdasdad"); msg.setHonourNote("asda"); msg.setMessageTypeCode(msgType); - msg.setProgramCadre("Adasd"); + msg.setFrenchImmersionMessage("Adasd"); msg.setGradProjectedMessage("sdada"); msg.setProgramCode(gradProgram); msg.setTranscriptMessageID(new UUID(1, 1)); From 043a9e95eba8c1b9439e51ae4227a3212948d699 Mon Sep 17 00:00:00 2001 From: arybakov Date: Fri, 5 Jan 2024 09:56:40 -0700 Subject: [PATCH 2/2] GRAD2-1704 Rename column in API Student Graduation TRANSCRIPT_MESSAGE --- api/src/test/resources/json/studentgraduation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/test/resources/json/studentgraduation.json b/api/src/test/resources/json/studentgraduation.json index 7439768e..0fc8a7a4 100644 --- a/api/src/test/resources/json/studentgraduation.json +++ b/api/src/test/resources/json/studentgraduation.json @@ -853,7 +853,7 @@ "gradDateMessage": "Graduation Date: %s", "honourNote": "Based on the information provided by the school, this student has graduated in the %s with Honours.", "adIBProgramMessage": "This student has also participated in: %s", - "programCadre": "This student has also successfully completed the %s Program", + "frenchImmersionMessage": "This student has also successfully completed the %s Program", "careerProgramMessage": "This student has participated in Career Program(s): %s", "gradProjectedMessage": "Based on the information provided by the school, this student should be able to graduate on the %s", "honourProjectedNote": "Based on the information provided by the school, this student should be able to graduate on the %s with honours", @@ -871,7 +871,7 @@ "gradDateMessage": null, "honourNote": null, "adIBProgramMessage": "This student is also participating in: %s", - "programCadre": "This student is also participating in the %s Program", + "frenchImmersionMessage": "This student is also participating in the %s Program", "careerProgramMessage": "This student is participating in Career Program(s): %s", "gradProjectedMessage": "Based on the information provided by the school, this student cannot satisfy the requirements for the %s.", "honourProjectedNote": null,