diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-10-26 19:36:45 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-10-26 19:56:43 +0530 |
commit | ef7de3edf23a0c6fba6e6fb3e175798adc532d78 (patch) | |
tree | 56ec5aae3b083acc147c9137ab2733caddef6bc8 /framework/src | |
parent | b0d8aa12fe8f88059f7fcce741913194d72d0d69 (diff) |
Fix the sample file name align with schema
CLI-55
Change-Id: I84533921d6a2bbfd818e0c68b723d6f131a21b2c
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java index 1e202a54..90ac961e 100644 --- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java +++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java @@ -99,10 +99,10 @@ public class OnapHttpCommand extends OnapCommand { for (OnapCommandResultAttribute attr : this.getResult().getRecords()) { attr.setValues(results.get(attr.getName())); } - generateJsonMock(httpInput, output, this.getName()); + generateJsonMock(httpInput, output, this.getSchemaName()); } - private void generateJsonMock(HttpInput httpInput, HttpResult httpResult, String fileName) + private void generateJsonMock(HttpInput httpInput, HttpResult httpResult, String schemaName) throws OnapCommandFailedMocoGenerate { if (OnapCommandConfg.isSampleGenerateEnabled()) { @@ -118,9 +118,9 @@ public class OnapHttpCommand extends OnapCommand { mockResponse.setJson(httpResult.getBody()); MockJsonGenerator.generateMocking(mockRequest, mockResponse, OnapCommandConfg.getSampleGenerateTargetFolder() - + "/" + fileName); + + "/" + schemaName.replace(".yaml", "") + "-moco.json"); } catch (IOException error) { - throw new OnapCommandFailedMocoGenerate(fileName, error); + throw new OnapCommandFailedMocoGenerate(schemaName, error); } } } |