summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam <kanagaraj.manickam@huawei.com>2020-08-18 08:52:30 +0000
committerGerrit Code Review <gerrit@onap.org>2020-08-18 08:52:30 +0000
commit87abb288ba1e107fb75148effd967420b6c76148 (patch)
tree11ca9daccc379d4aae0b47410f7f14d25c23d79c
parente35049f670fb3ecbfa15f2dfb15bd5338f591eab (diff)
parent59178f7231980682c9483d3ed8a6bf5307473f9b (diff)
Merge "Migrate from java 8 to 11"
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/pom.xml13
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java8
2 files changed, 16 insertions, 5 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/pom.xml b/vnfmarket-be/vnf-sdk-marketplace/pom.xml
index b7945bdf..41139fb3 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/pom.xml
+++ b/vnfmarket-be/vnf-sdk-marketplace/pom.xml
@@ -26,11 +26,17 @@
<maven.test.skip>false</maven.test.skip>
<maven.test.failure.ignore>false</maven.test.failure.ignore>
<swagger-ui.version>3.12.0</swagger-ui.version>
+ <jmockit.version>1.43</jmockit.version>
</properties>
<dependencies>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.1</version>
+ </dependency>
<!-- oclip -->
<dependency>
<groupId>org.onap.cli</groupId>
@@ -205,7 +211,7 @@ due to Security Issues:- CVE-2019-10241,CVE-2019-10247,CVE-2019-10246
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
- <version>1.19</version>
+ <version>${jmockit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -264,7 +270,10 @@ due to Security Issues:- CVE-2019-10241,CVE-2019-10247,CVE-2019-10246
<version>2.20</version>
<configuration>
<forkMode>always</forkMode>
- <argLine>${surefireArgLine}</argLine>
+ <argLine>
+ -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
+ <!--${surefireArgLine}-->
+ </argLine>
<skip>${maven.test.skip}</skip>
<testFailureIgnore>${maven.test.failure.ignore}</testFailureIgnore>
<!-- Excludes integration tests when unit tests are run. -->
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
index 2ecb5a76..bf71dfea 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/test/java/org/onap/vnfsdk/marketplace/resource/PackageResourceTest.java
@@ -75,6 +75,8 @@ import org.onap.vnfsdk.marketplace.wrapper.PackageWrapper;
import org.onap.vnfsdk.marketplace.wrapper.PackageWrapperUtil;
import org.open.infc.grpc.Result;
import org.open.infc.grpc.client.OpenRemoteCli;
+import javax.servlet.ServletRequest;
+import mockit.Mocked;
import mockit.Mock;
import mockit.MockUp;
@@ -1016,8 +1018,8 @@ public class PackageResourceTest {
}
@Test
- public void testUpdateStatusSuccess() {
- MockUp mockReq = new MockUp<HttpServletRequest>() {
+ public void testUpdateStatusSuccess(@Mocked HttpServletRequest request) {
+ new MockUp<ServletRequest>() {
@Mock
public ServletInputStream getInputStream() throws IOException {
@@ -1047,7 +1049,7 @@ public class PackageResourceTest {
};
try {
- response = packageResource.updateValidateStatus((HttpServletRequest) mockReq.getMockInstance(), null);
+ response = packageResource.updateValidateStatus(request, null);
} catch(Exception e) {
e.printStackTrace();
}