/*-\r
* ============LICENSE_START=======================================================\r
- * PROJECT\r
+ * org.onap.dcaegen2.collectors.ves\r
* ================================================================================\r
* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.\r
+ * Copyright (C) 2018 Nokia. All rights reserved.\r
* ================================================================================\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
* You may obtain a copy of the License at\r
- * \r
+ *\r
* http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
+ *\r
* Unless required by applicable law or agreed to in writing, software\r
* distributed under the License is distributed on an "AS IS" BASIS,\r
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
*/\r
package org.onap.dcae.vestest;\r
\r
-import org.junit.After;\r
-import org.junit.Assert;\r
-import org.junit.Before;\r
-import org.junit.Test;\r
+import static org.junit.Assert.assertEquals;\r
\r
+import java.util.HashMap;\r
+import org.junit.Test;\r
import org.onap.dcae.commonFunction.DmaapPropertyReader;\r
\r
public class TestDmaapPropertyReader {\r
\r
- DmaapPropertyReader dr;\r
-\r
- Boolean flag = false;\r
-\r
- @Before\r
- public void setUp() throws Exception {\r
-\r
- // process command line arguments\r
-\r
- \r
-\r
- }\r
-\r
- @After\r
- public void tearDown() throws Exception {\r
-\r
- }\r
-\r
- @Test\r
- public void testDmaapPropertyReader() {\r
- String testinput = "src/test/resources/testDmaapConfig_ip.json";\r
- dr = new DmaapPropertyReader(testinput);\r
- Boolean test = true;\r
- flag = !dr.dmaap_hash.isEmpty();\r
- Assert.assertEquals(test, flag);\r
- }\r
+ @Test\r
+ public void shouldReadDMaaPHashes() {\r
+ DmaapPropertyReader dmaapPropertyReader = new DmaapPropertyReader("src/test/resources/testDmaapConfig_ip.json");\r
+ HashMap<String, String> dmaapHash = dmaapPropertyReader.dmaap_hash;\r
+ assertEquals(dmaapHash.get("sec_fault_ueb.cambria.hosts"),\r
+ "uebsb91kcdc.it.att.com,uebsb92kcdc.it.att.com,uebsb93kcdc.it.att.com");\r
+ assertEquals(dmaapHash.get("sec_fault_ueb.cambria.topic"), "DCAE-SE-COLLECTOR-EVENTS-DEV");\r
+ }\r
+\r
+ @Test\r
+ public void shouldReadDMaaPHashesForSecondGeneration() {\r
+ DmaapPropertyReader dmaapPropertyReader = new DmaapPropertyReader(\r
+ "src/test/resources/testDmaapConfig_gen2.json");\r
+ HashMap<String, String> dmaapHash = dmaapPropertyReader.dmaap_hash;\r
+ assertEquals(dmaapHash.get("ves-thresholdCrossingAlert-secondary.cambria.topic"),\r
+ "DCAE-SE-COLLECTOR-EVENTS-DEV");\r
+ assertEquals(dmaapHash.get("ves-thresholdCrossingAlert-secondary.cambria.url"), "UEBHOST:3904");\r
+ assertEquals(dmaapHash.get("ves-fault-secondary.cambria.url"), "UEBHOST:3904");\r
+ assertEquals(dmaapHash.get("ves-fault-secondary.cambria.topic"), "DCAE-SE-COLLECTOR-EVENTS-DEV");\r
+ }\r
\r
- @Test\r
- public void testDmaapPropertyReaderNewConfig() {\r
- String testinput = "src/test/resources/testDmaapConfig_gen2.json";\r
- dr = new DmaapPropertyReader(testinput);\r
- Boolean test = true;\r
- flag = !dr.dmaap_hash.isEmpty();\r
- Assert.assertEquals(test, flag);\r
- }\r
}\r
\r