aboutsummaryrefslogtreecommitdiffstats
path: root/validate
diff options
context:
space:
mode:
authorsharath reddy <bs.reddy@huawei.com>2022-03-25 12:44:19 +0530
committersharath reddy <bs.reddy@huawei.com>2022-03-25 13:19:08 +0530
commit2073da6514668ce17e7359900439354fb3432f4e (patch)
tree582571835a61daec0bceeaa7d65805c4e3cbb119 /validate
parentf439543779cf2dfac0b68443aea921c55983bf48 (diff)
Fixed Sonar Bug and Code Smell Blockers
Issue-ID: CLI-439 Signed-off-by: sharath reddy <bs.reddy@huawei.com> Change-Id: I81bd79661ab7c6b1152fa481d9273a86e77b4f3a Signed-off-by: sharath reddy <bs.reddy@huawei.com>
Diffstat (limited to 'validate')
-rw-r--r--validate/sample-mock-generator/pom.xml6
-rw-r--r--validate/sample-mock-generator/src/test/java/org/onap/cli/http/mock/MockJsonGeneratorTest.java3
-rw-r--r--validate/sample-yaml-generator/pom.xml6
-rw-r--r--validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java9
4 files changed, 19 insertions, 5 deletions
diff --git a/validate/sample-mock-generator/pom.xml b/validate/sample-mock-generator/pom.xml
index a61ffb41..db65484b 100644
--- a/validate/sample-mock-generator/pom.xml
+++ b/validate/sample-mock-generator/pom.xml
@@ -48,6 +48,12 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <version>5.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.43</version>
diff --git a/validate/sample-mock-generator/src/test/java/org/onap/cli/http/mock/MockJsonGeneratorTest.java b/validate/sample-mock-generator/src/test/java/org/onap/cli/http/mock/MockJsonGeneratorTest.java
index 0e0c0f59..d4697978 100644
--- a/validate/sample-mock-generator/src/test/java/org/onap/cli/http/mock/MockJsonGeneratorTest.java
+++ b/validate/sample-mock-generator/src/test/java/org/onap/cli/http/mock/MockJsonGeneratorTest.java
@@ -18,6 +18,7 @@ package org.onap.cli.http.mock;
import java.io.IOException;
import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
public class MockJsonGeneratorTest {
@@ -32,6 +33,6 @@ public class MockJsonGeneratorTest {
mockResponse.setStatus(200);
mockResponse.setJson("{\"value\" : \"234sdf-345\"}");
- MockJsonGenerator.generateMocking(mockRequest, mockResponse, "target/test");
+ assertDoesNotThrow(() -> MockJsonGenerator.generateMocking(mockRequest, mockResponse, "target/test"));
}
}
diff --git a/validate/sample-yaml-generator/pom.xml b/validate/sample-yaml-generator/pom.xml
index 80480915..5733bf04 100644
--- a/validate/sample-yaml-generator/pom.xml
+++ b/validate/sample-yaml-generator/pom.xml
@@ -50,6 +50,12 @@
<version>1.19</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <version>5.8.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java b/validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java
index dc99df02..5a6f3db9 100644
--- a/validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java
+++ b/validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java
@@ -20,19 +20,20 @@ import java.io.IOException;
import java.util.Arrays;
import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
public class SampleYamlGeneratorTest {
@Test
public void testGenerateSampleYaml() throws IOException {
- SampleYamlGenerator.generateSampleYaml("testcmd", Arrays.asList("-a", "argument"),
- "+--------+\n+val +\n+argument+", "test-version-1.0", "target/test.yaml", false, "sample1");
+ assertDoesNotThrow(() -> SampleYamlGenerator.generateSampleYaml("testcmd", Arrays.asList("-a", "argument"),
+ "+--------+\n+val +\n+argument+", "test-version-1.0", "target/test.yaml", false, "sample1"));
}
@Test
public void testGenerateSampleYamlForWriteMultilineKeyValue() throws IOException {
- SampleYamlGenerator.generateSampleYaml("testcmd-multiline", Arrays.asList("-a", "argument"),
+ assertDoesNotThrow(() -> SampleYamlGenerator.generateSampleYaml("testcmd-multiline", Arrays.asList("-a", "argument"),
"+--------+\n+testval1 +\n+argument1+\n+testval2 +\n+argument2+", "test-version-1.0",
- "target/test-multiline.yaml", true, "sample1");
+ "target/test-multiline.yaml", true, "sample1"));
}
}