aboutsummaryrefslogtreecommitdiffstats
path: root/validate
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-05-11 04:46:07 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-11 04:46:07 +0000
commit0fa052c994c900ff809d5ff32d93752190e3ff5a (patch)
treeeb78c482d5846bb7a24f4f5ad1257514bb1f32d1 /validate
parent7f3a150c231da1dcff306ec1e74517416ff3c972 (diff)
parent81c3cbfc6ff60fc705d142a88a64654a75c010e0 (diff)
Merge changes I81537658,I653a2ed5,I1aa94f93,I500b4755,I0c379ae2
* changes: sonar security issue fix- Make sure that using a regular expression is safe here sonar security issue fix- Make sure that environment variables are used safely here sonar vulnerability issue fix- Do something with the "boolean" value returned by "delete"; Enable server certificate validation on this SSL/TLS connection sonar bug fix- conditional operation returns the same value whether the condition is "true" or "false" sonar bug fix- Use the "equals" method if value comparison was intended
Diffstat (limited to 'validate')
-rw-r--r--validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java3
-rw-r--r--validate/sample-yaml-generator/src/test/java/org/onap/cli/sample/yaml/SampleYamlGeneratorTest.java6
2 files changed, 7 insertions, 2 deletions
diff --git a/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java b/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java
index 37c51401..bc8f456e 100644
--- a/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java
+++ b/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java
@@ -61,8 +61,7 @@ public class SampleYamlGenerator {
writer.write(" |\n");
nTab++;
String[] lines = value.split("\n");
- long skipLines = debug ? 0 : 0;
- Arrays.stream(lines).skip(skipLines ).forEach(line -> writer.write(printTabs() + line + "\n")); // NOSONAR
+ Arrays.stream(lines).forEach(line -> writer.write(printTabs() + line + "\n")); // NOSONAR
}
private static String printTabs() {
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 cd395833..dc99df02 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
@@ -28,5 +28,11 @@ public class SampleYamlGeneratorTest {
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"),
+ "+--------+\n+testval1 +\n+argument1+\n+testval2 +\n+argument2+", "test-version-1.0",
+ "target/test-multiline.yaml", true, "sample1");
+ }
}