diff options
author | 2021-03-24 01:38:53 -0700 | |
---|---|---|
committer | 2021-03-29 04:21:47 -0700 | |
commit | cb9221b9e2afdf363b97c2cf60d1dbd1195ea196 (patch) | |
tree | 7037c108aa2d1102e5fb7ded17a0fc195a77088b /components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java | |
parent | a652db5d8c8fb8a353893cf0e8c811cf0f3448e6 (diff) |
Increase code coverage
Issue-ID: DCAEGEN2-2695
Signed-off-by: denilson.l65 <denilson.l65@wipro.com>
Change-Id: I256ec691bfc967085e2d7335df43701251607c56
Diffstat (limited to 'components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java')
-rw-r--r-- | components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java index eb492800..ed583cad 100644 --- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java +++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/models/ConfigurationTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * slice-analysis-ms * ================================================================================ - * Copyright (C) 2020 Wipro Limited. + * Copyright (C) 2020-2021 Wipro Limited. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,30 +18,20 @@ * ============LICENSE_END========================================================= * *******************************************************************************/ - - package org.onap.slice.analysis.ms.models; - import static org.junit.Assert.assertEquals; - import java.util.ArrayList; -import java.util.HashMap; +import java.util.Collections; import java.util.List; import java.util.Map; - import org.junit.Test; - - public class ConfigurationTest { Configuration configuration = Configuration.getInstance(); - @Test public void configurationTest() { - List<String> list = new ArrayList<String>(); list.add("server"); - Map<String, Object> subscribes = new HashMap<>(); - + Map<String, Object> subscribes = Collections.emptyMap(); configuration.setStreamsSubscribes(subscribes); configuration.setStreamsPublishes(subscribes); configuration.setDmaapServers(list); @@ -56,18 +46,32 @@ public class ConfigurationTest { configuration.setPollingInterval(30); configuration.setPollingTimeout(100); configuration.setConfigDbService("sdnrService"); - - assertEquals("cg", configuration.getCg()); - assertEquals("cid", configuration.getCid()); + configuration.setCpsUrl(""); + configuration.setAaiUrl(""); + configuration.setConfigDbEnabled(true); + configuration.setSamples(10); + configuration.setMinPercentageChange(50); + configuration.setInitialDelaySeconds(1000); + assertEquals(true,configuration.isSecured()); assertEquals("user", configuration.getAafUsername()); assertEquals("password", configuration.getAafPassword()); - assertEquals("user", configuration.getPgUsername()); - assertEquals("password", configuration.getPgPassword()); - assertEquals("pg", configuration.getPgHost()); - assertEquals(5432, configuration.getPgPort()); + assertEquals(subscribes,configuration.getStreamsSubscribes()); + assertEquals(subscribes,configuration.getStreamsPublishes()); + assertEquals("cg", configuration.getCg()); + assertEquals("cid", configuration.getCid()); assertEquals(30, configuration.getPollingInterval()); assertEquals(100, configuration.getPollingTimeout()); - assertEquals("sdnrService", configuration.getConfigDbService()); + assertEquals("pg", configuration.getPgHost()); + assertEquals(5432, configuration.getPgPort()); + assertEquals("user", configuration.getPgUsername()); + assertEquals("password", configuration.getPgPassword()); assertEquals(list, configuration.getDmaapServers()); + assertEquals("sdnrService", configuration.getConfigDbService()); + assertEquals("",configuration.getCpsUrl()); + assertEquals("",configuration.getAaiUrl()); + assertEquals(true,configuration.getConfigDbEnabled()); + assertEquals(10,configuration.getSamples()); + assertEquals(50,configuration.getMinPercentageChange()); + assertEquals(1000,configuration.getInitialDelaySeconds()); } } |