From ef7de3edf23a0c6fba6e6fb3e175798adc532d78 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Thu, 26 Oct 2017 19:36:45 +0530 Subject: Fix the sample file name align with schema CLI-55 Change-Id: I84533921d6a2bbfd818e0c68b723d6f131a21b2c Signed-off-by: Kanagaraj Manickam k00365106 --- framework/src/main/java/org/onap/cli/fw/cmd/OnapHttpCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'framework/src/main/java/org') 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); } } } -- cgit 1.2.3-korg