summaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2023-04-28 15:02:00 +0100
committermpriyank <priyank.maheshwari@est.tech>2023-05-02 12:09:29 +0100
commit74cf06f7af65c699187f9e268db58023db2e2a62 (patch)
treefc9439384f1b5336e337da62f0841c969aded8fc /cps-service/src/test
parent5f964d1910e309502530631bff4d21e5d59f4dc8 (diff)
Align the hazelcast cluster names
- We need to align the hazelcast cluster names as members of the same cluster can join each other. We will still have exclusivity as the instance names and configs are different for each distributed object. - Exposing env variable to override the cluster name depending on the env it is run on. - Modified test cases to validate the cluster names as well Issue-ID: CPS-1637 Change-Id: Ib0f8c80dc9b2268f976b0c2d3ccd6d64792d4781 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-service/src/test')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy8
-rw-r--r--cps-service/src/test/resources/application.yml1
2 files changed, 6 insertions, 3 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy
index 76b5345534..e219945d83 100644
--- a/cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/cache/AnchorDataCacheConfigSpec.groovy
@@ -46,10 +46,12 @@ class AnchorDataCacheConfigSpec extends Specification {
def 'Verify configs for Distributed Caches'(){
given: 'the Anchor Data Cache config'
- def anchorDataCacheConfig = Hazelcast.getHazelcastInstanceByName('hazelCastInstanceCpsCore').config.mapConfigs.get('anchorDataCacheMapConfig')
+ def anchorDataCacheConfig = Hazelcast.getHazelcastInstanceByName('hazelCastInstanceCpsCore').config
+ def anchorDataCacheMapConfig = anchorDataCacheConfig.mapConfigs.get('anchorDataCacheMapConfig')
expect: 'system created instance with correct config'
- assert anchorDataCacheConfig.backupCount == 3
- assert anchorDataCacheConfig.asyncBackupCount == 3
+ assert anchorDataCacheConfig.clusterName == 'cps-and-ncmp-test-caches'
+ assert anchorDataCacheMapConfig.backupCount == 3
+ assert anchorDataCacheMapConfig.asyncBackupCount == 3
}
def 'Verify deployment network configs for Distributed Caches'() {
diff --git a/cps-service/src/test/resources/application.yml b/cps-service/src/test/resources/application.yml
index 21f3745337..dc100667ba 100644
--- a/cps-service/src/test/resources/application.yml
+++ b/cps-service/src/test/resources/application.yml
@@ -51,6 +51,7 @@ logging:
# Custom Hazelcast Config.
hazelcast:
+ cluster-name: "cps-and-ncmp-test-caches"
mode:
kubernetes:
enabled: false