Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vasudevganesanhmcts committed Oct 23, 2024
1 parent ce8b05c commit 5582a79
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ public boolean isCjesServiceAvailable() {
}

public boolean isCarmEnabledForCase(CaseData caseData) {
return SPEC_CLAIM.equals(caseData.getCaseAccessCategory());
ZoneId zoneId = ZoneId.systemDefault();
long epoch = caseData.getSubmittedDate().atZone(zoneId).toEpochSecond();
boolean isSpecClaim = SPEC_CLAIM.equals(caseData.getCaseAccessCategory());
return isSpecClaim && featureToggleApi.isFeatureEnabled("carm")
&& featureToggleApi.isFeatureEnabledForDate("cam-enabled-for-case",
epoch, false);
}

public boolean isGaForLipsEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,25 @@ void shouldReturnCorrectValue_whenisCjesServiceAvailableEnabled(Boolean toggleSt
assertThat(featureToggleService.isCjesServiceAvailable()).isEqualTo(toggleStat);
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
void shouldReturnCorrectValue_whenIsCarmEnabled(Boolean toggleStat) {
var carmKey = "carm";
var carmDateKey = "cam-enabled-for-case";
givenToggle(carmKey, toggleStat);

CaseData caseData = CaseDataBuilder.builder().atStateClaimIssued()
.setClaimTypeToSpecClaim()
.build();

if (toggleStat) {
when(featureToggleApi.isFeatureEnabledForDate(eq(carmDateKey), anyLong(), eq(false)))
.thenReturn(true);
}

assertThat(featureToggleService.isCarmEnabledForCase(caseData)).isEqualTo(toggleStat);
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
void shouldReturnCorrectValue_whenMultiOrIntermediateTrackEnabled(Boolean toggleStat) {
Expand Down

0 comments on commit 5582a79

Please sign in to comment.