Skip to content

Commit be5c153

Browse files
committed
Merge branch 'cbrelease-4.8.30' into cbrelease-4.8.31
# Conflicts: # Dockerfile # src/test/java/com/igot/cb/profile/ProfileServiceImplTest.java
2 parents 99b3980 + 48f663a commit be5c153

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:17-jdk-jammy
1+
FROM sivaprakash123/openjdk:17-slim-debian11
22
# Install necessary dependencies
33
RUN apt-get update \
44
&& apt-get install -y \

src/test/java/com/igot/cb/profile/ProfileServiceImplTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ void returnsCachedCertificateCount_whenCacheHit() {
15471547
ReflectionTestUtils.setField(localService, "serverConfig", serverConfig);
15481548
when(serverConfig.getCertificateCountRedisKey()).thenReturn("cert:count");
15491549
when(serverConfig.getDataIndex()).thenReturn(12);
1550-
when(serverConfig.getCacheTtl()).thenReturn(100);
1550+
when(serverConfig.getCertificateCountRedisTtl()).thenReturn(100);
15511551
when(localCacheService.hget("cert:count", 12, "user-1", 100)).thenReturn("7");
15521552
int count = ReflectionTestUtils.invokeMethod(localService, "getIssuedCertificateCount", "user-1");
15531553
assertEquals(7, count);
@@ -1566,7 +1566,7 @@ void returnsSumOfCertificatesFromBothSources_whenCacheMiss() {
15661566
ReflectionTestUtils.setField(locaService, "serverConfig", serverConfig);
15671567
when(serverConfig.getCertificateCountRedisKey()).thenReturn("cert:count");
15681568
when(serverConfig.getDataIndex()).thenReturn(12);
1569-
when(serverConfig.getCacheTtl()).thenReturn(100);
1569+
when(serverConfig.getCertificateCountRedisTtl()).thenReturn(100);
15701570
when(localCacheService.hget("cert:count", 12, "user-2", 100)).thenReturn(null);
15711571

15721572
List<Map<String, Object>> courseRecords = List.of(
@@ -1594,7 +1594,7 @@ void returnsSumOfCertificatesFromBothSources_whenCacheMiss() {
15941594

15951595
int count = ReflectionTestUtils.invokeMethod(locaService, "getIssuedCertificateCount", "user-2");
15961596
assertEquals(5, count);
1597-
verify(localCacheService).hset("cert:count", 12, "user-2", "5",0);
1597+
verify(localCacheService).hset("cert:count", 12, "user-2", "5",100);
15981598
}
15991599

16001600
@Test
@@ -1608,7 +1608,7 @@ void returnsZero_whenNoCertificatesAndCacheMiss() {
16081608
ReflectionTestUtils.setField(localService, "serverConfig", serverConfig);
16091609
when(serverConfig.getCertificateCountRedisKey()).thenReturn("cert:count");
16101610
when(serverConfig.getDataIndex()).thenReturn(12);
1611-
when(serverConfig.getCacheTtl()).thenReturn(100);
1611+
when(serverConfig.getCertificateCountRedisTtl()).thenReturn(100);
16121612
when(localCacheService.hget("cert:count", 12, "user-3", 100)).thenReturn(null);
16131613
when(localCassandraOperation.getRecordsByPropertiesByKey(
16141614
anyString(), eq(Constants.USER_ENROLMENTS), anyMap(), anyList(), eq("user-3")
@@ -1619,7 +1619,7 @@ void returnsZero_whenNoCertificatesAndCacheMiss() {
16191619
int count = ReflectionTestUtils.invokeMethod(localService, "getIssuedCertificateCount", "user-3");
16201620
assertEquals(0, count);
16211621
//verify(localCacheService).hset("cert:count", 12, "user-3", "0");
1622-
verify(localCacheService, never()).hset(anyString(), anyInt(), anyString(), anyString(),0);
1622+
verify(localCacheService, never()).hset(anyString(), anyInt(), anyString(), anyString(), eq(100));
16231623
}
16241624

16251625
@Test
@@ -1633,7 +1633,7 @@ void returnsZero_whenExceptionIsThrown() {
16331633
ReflectionTestUtils.setField(localService, "serverConfig", serverConfig);
16341634
when(serverConfig.getCertificateCountRedisKey()).thenReturn("cert:count");
16351635
when(serverConfig.getDataIndex()).thenReturn(12);
1636-
when(serverConfig.getCacheTtl()).thenReturn(100);
1636+
when(serverConfig.getCertificateCountRedisTtl()).thenReturn(100);
16371637
when(localCacheService.hget(anyString(), anyInt(), anyString(), anyInt())).thenThrow(new RuntimeException("fail"));
16381638
int count = ReflectionTestUtils.invokeMethod(localService, "getIssuedCertificateCount", "user-4");
16391639
assertEquals(0, count);
@@ -1650,7 +1650,7 @@ void ignoresNonListIssuedCertificatesAndNulls() {
16501650
ReflectionTestUtils.setField(locaService, "serverConfig", serverConfig);
16511651
when(serverConfig.getCertificateCountRedisKey()).thenReturn("cert:count");
16521652
when(serverConfig.getDataIndex()).thenReturn(12);
1653-
when(serverConfig.getCacheTtl()).thenReturn(100);
1653+
when(serverConfig.getCertificateCountRedisTtl()).thenReturn(100);
16541654

16551655
List<Map<String, Object>> courseRecords = List.of(
16561656
new HashMap<String, Object>() {{ put(Constants.ISSUED_CERTIFICATES_KEY, null); }},
@@ -1674,7 +1674,7 @@ void ignoresNonListIssuedCertificatesAndNulls() {
16741674

16751675
int count = ReflectionTestUtils.invokeMethod(locaService, "getIssuedCertificateCount", "user-5");
16761676
assertEquals(0, count);
1677-
verify(localCacheService, never()).hset(anyString(), anyInt(), anyString(), anyString(),0);
1677+
verify(localCacheService, never()).hset(anyString(), anyInt(), anyString(), anyString(), eq(100));
16781678
}
16791679

16801680
@Test

0 commit comments

Comments
 (0)