From ab103ea9ca9eb9fe580e1ccbc90cc7aad546672c Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 10:25:13 -0700 Subject: [PATCH 1/6] move file --- .../cms/ab2d/contracts/{utils => model}/ContractTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/{utils => model}/ContractTest.java (97%) diff --git a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/utils/ContractTest.java b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java similarity index 97% rename from ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/utils/ContractTest.java rename to ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java index bae09e11..d9837740 100644 --- a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/utils/ContractTest.java +++ b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java @@ -1,7 +1,5 @@ -package gov.cms.ab2d.contracts.utils; +package gov.cms.ab2d.contracts.model; -import gov.cms.ab2d.contracts.model.Contract; -import gov.cms.ab2d.contracts.model.ContractDTO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -13,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -public class ContractTest { +class ContractTest { private static final String CONTRACT_NAME = "Name"; private static final String PARENT_NAME = "Parent"; private static final String MARKETING_NAME = "Marketing Name"; From 6e7faca654aa62522c68c35c2c0081fa65eb3601 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 11:30:35 -0700 Subject: [PATCH 2/6] ContractTest --- .../ab2d/contracts/model/ContractTest.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java index d9837740..4f295f83 100644 --- a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java +++ b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java @@ -5,18 +5,21 @@ import java.time.OffsetDateTime; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -class ContractTest { +class g { private static final String CONTRACT_NAME = "Name"; private static final String PARENT_NAME = "Parent"; private static final String MARKETING_NAME = "Marketing Name"; private static final String CONTRACT_NUMBER = "S12345"; private static final OffsetDateTime NOW = OffsetDateTime.now(); + public static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd H:m:s"); + private static final String NOW_STRING = NOW.format(FORMATTER).toString(); private static final Long ID = 1L; private static final Long PARENT_ID = 2L; private static final Integer MEDICARE_ELIGIBLE = 95; @@ -52,8 +55,32 @@ void testContract() { TOTAL_ENROLLMENT - 1, MEDICARE_ELIGIBLE)); assertTrue(contract.hasChanges(MARKETING_NAME, PARENT_ID, PARENT_NAME, MARKETING_NAME, null, null)); + assertFalse(contract.hasChanges(CONTRACT_NAME, PARENT_ID, PARENT_NAME, MARKETING_NAME, + TOTAL_ENROLLMENT, MEDICARE_ELIGIBLE)); + } + + @Test + void testUpdateAttestationCaseOne() { + assertTrue(contract.updateAttestation(false, NOW_STRING)); } + @Test + void testUpdateAttestationCaseTwo() { + contract.setUpdateMode(Contract.UpdateMode.MANUAL); + assertFalse(contract.updateAttestation(false, NOW_STRING)); + } + + @Test + void testUpdateAttestationCaseThree() { + contract.setAttestedOn(null); + assertTrue(contract.updateAttestation(true, NOW_STRING)); + } + + @Test + void testUpdateAttestationCaseFour() { + contract.setAttestedOn(null); + assertFalse(contract.updateAttestation(false, NOW_STRING)); + } @Test void testOther() { From fbe2d257ba67c03794bf9f68d577d5df6e63a7d1 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 11:34:12 -0700 Subject: [PATCH 3/6] typo From e1bb61f97236a1e85bc2d812c7634b8aa1cf3f2e Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 11:34:40 -0700 Subject: [PATCH 4/6] typo --- .../test/java/gov/cms/ab2d/contracts/model/ContractTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java index 4f295f83..1330699e 100644 --- a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java +++ b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -class g { +class ContractTest { private static final String CONTRACT_NAME = "Name"; private static final String PARENT_NAME = "Parent"; private static final String MARKETING_NAME = "Marketing Name"; From 96ab0c063366a313302fd51d7a4fd8576e826133 Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 12:07:28 -0700 Subject: [PATCH 5/6] ContractDTOTest --- .../ab2d/contracts/model/ContractDTOTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractDTOTest.java diff --git a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractDTOTest.java b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractDTOTest.java new file mode 100644 index 00000000..59d3716a --- /dev/null +++ b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractDTOTest.java @@ -0,0 +1,24 @@ +package gov.cms.ab2d.contracts.model; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class ContractDTOTest { + + @Test + void testHasDateIssueCaseOne() { + ContractDTO contractDTO = new ContractDTO(); + contractDTO.setContractType(Contract.ContractType.CLASSIC_TEST); + assertTrue(contractDTO.hasDateIssue()); + } + + @Test + void testHasDateIssueCaseTwo() { + ContractDTO contractDTO = new ContractDTO(); + contractDTO.setContractType(Contract.ContractType.NORMAL); + assertFalse(contractDTO.hasDateIssue()); + } + +} From 1748306584c1a2612b93f566e0437a4a9c438a2a Mon Sep 17 00:00:00 2001 From: Kai Siren Date: Mon, 24 Jun 2024 12:19:31 -0700 Subject: [PATCH 6/6] private --- .../test/java/gov/cms/ab2d/contracts/model/ContractTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java index 1330699e..adba35ce 100644 --- a/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java +++ b/ab2d-contracts-client/src/test/java/gov/cms/ab2d/contracts/model/ContractTest.java @@ -18,7 +18,7 @@ class ContractTest { private static final String MARKETING_NAME = "Marketing Name"; private static final String CONTRACT_NUMBER = "S12345"; private static final OffsetDateTime NOW = OffsetDateTime.now(); - public static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd H:m:s"); + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd H:m:s"); private static final String NOW_STRING = NOW.format(FORMATTER).toString(); private static final Long ID = 1L; private static final Long PARENT_ID = 2L;