diff options
author | 2019-09-30 05:00:42 +0000 | |
---|---|---|
committer | 2019-09-30 05:00:42 +0000 | |
commit | 1d4b83754009114523cae90c759daffa9188eb3e (patch) | |
tree | f04dd900e8bf43406c6894c9bbed7d6485cfd236 /validate/sample-yaml-generator | |
parent | 812b3cb79e7b4f0adff8f44b269cdfa679127c90 (diff) | |
parent | 08f6cbf5307459ac3e91fc2c98f9b76010b23d4a (diff) |
Merge "Fix ovp lcm validation"
Diffstat (limited to 'validate/sample-yaml-generator')
2 files changed, 6 insertions, 3 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 b2e2dc88..37c51401 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 @@ -28,15 +28,18 @@ public class SampleYamlGenerator { static int nTab; public static void generateSampleYaml(String cmdName, List<String> input, String output, String version, - String targetPath, boolean debug) throws IOException { + String targetPath, boolean debug, String name) throws IOException { PrintWriter writer = new PrintWriter(targetPath, "UTF-8"); writeKeyValuePair(writer, "open_cli_sample_version", "1.0"); writeKeyValuePair(writer, "name", cmdName); writeKeyValuePair(writer, "version", version); + if (name == null) { + name = "sample1"; + } writeKey(writer, "samples"); - writeKey(writer, "sample1"); + writeKey(writer, name); writeKeyValuePair(writer, "name", cmdName); writeKeyValuePair(writer, "input", input.stream().collect(Collectors.joining(" ")).trim()); 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 fba93e62..cd395833 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 @@ -26,7 +26,7 @@ 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); + "+--------+\n+val +\n+argument+", "test-version-1.0", "target/test.yaml", false, "sample1"); } } |