From a3d9cc0ea44b7ac13c5c56506aabcb5a43b8068f Mon Sep 17 00:00:00 2001 From: sharath reddy Date: Tue, 17 May 2022 11:00:18 +0530 Subject: 1. Comment addition on explaining why this method is empty 2.Arguments swapping to maintain in correct order https://sonarcloud.io/project/issues?resolved=false&severities=CRITICAL&id=onap_vnfsdk-validation&open=AW6lcX93wQN7qqDOuZdl https://sonarcloud.io/project/issues?resolved=false&severities=MAJOR&id=onap_vnfsdk-validation&open=AXb86PeCWcGc8ovkTVG3 Issue-ID: VNFSDK-832 Signed-off-by: sharath reddy Change-Id: I142dda1ba74f1d2aff51cdfd81dac5d9580586ea Signed-off-by: sharath reddy --- .../java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java | 1 + .../java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java | 1 + .../java/org/onap/cvc/csar/security/SignatureFactoryTest.java | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java index 96181fd..6053d2e 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java @@ -25,6 +25,7 @@ public class VTPValidateCSARR17852 extends VTPValidateCSARBase { @Override protected void validateCSAR(CSARArchive csar) throws Exception { + //Implementing an abstract method } @Override diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java index bc680a3..7900908 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java @@ -25,6 +25,7 @@ public class VTPValidateCSARR46527 extends VTPValidateCSARBase { @Override protected void validateCSAR(CSARArchive csar) throws Exception { + //Implementing an abstract method } @Override diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/security/SignatureFactoryTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/security/SignatureFactoryTest.java index baa88c0..7e017fa 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/security/SignatureFactoryTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/security/SignatureFactoryTest.java @@ -134,7 +134,7 @@ public class SignatureFactoryTest { @Test public void shouldCreateContentInfoWithProperContentForDecodedPKCS7() throws IOException, CmsSignatureLoadingException { // given - InputStream signatureAsStream = loadFileFromResources("./security/signature/testEncodedSignature.sig.p7c"); + InputStream signatureAsStream = loadFileFromResources(); // when ContentInfo contentInfo = signatureFactory.createSignature(signatureAsStream.readAllBytes()); @@ -144,10 +144,10 @@ public class SignatureFactoryTest { assertThat(testPkcs7Signature).contains(contentInfoSignature); } - private InputStream loadFileFromResources(String fileFromResources) throws IOException{ - InputStream resourceAsStream = SignatureFactoryTest.class.getClassLoader().getResourceAsStream(fileFromResources); + private InputStream loadFileFromResources() throws IOException{ + InputStream resourceAsStream = SignatureFactoryTest.class.getClassLoader().getResourceAsStream("./security/signature/testEncodedSignature.sig.p7c"); if(resourceAsStream==null) { - throw new IOException(String.format("fail to load file: %s from resourcer", fileFromResources)); + throw new IOException(String.format("fail to load file: %s from resourcer", "./security/signature/testEncodedSignature.sig.p7c")); } return resourceAsStream; } -- cgit 1.2.3-korg