From 78d153ed8b83f1350fb5fbfdbdcd5085601695ea Mon Sep 17 00:00:00 2001 From: MD IRSHAD SHEIKH Date: Wed, 23 Mar 2022 19:38:07 +0530 Subject: Remove unused import statement and import specific classes Issue-ID: SO-3911 Signed-off-by: MD IRSHAD SHEIKH Change-Id: I153c94fbb561c8acfc54cb09a5ab74eea85bf231 --- .../controller/NssmfAdapterControllerTest.java | 2 -- .../so/adapters/nssmf/entity/RestResponseTest.java | 3 +- .../nssmf/exceptions/ApplicationExceptionTest.java | 3 +- .../service/impl/NssmfManagerServiceImplTest.java | 38 ++++++++++++++++++---- .../onap/so/adapters/nssmf/util/RestUtilTest.java | 12 ++----- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterControllerTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterControllerTest.java index 3a57938..a4cdde5 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterControllerTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/controller/NssmfAdapterControllerTest.java @@ -22,7 +22,6 @@ package org.onap.so.adapters.nssmf.controller; import org.junit.Before; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.onap.so.adapters.nssmf.controller.NssmfAdapterController; import org.onap.so.adapters.nssmf.service.NssmfManagerService; import org.onap.so.beans.nsmf.NssmfAdapterNBIRequest; import org.springframework.http.ResponseEntity; @@ -34,7 +33,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import static org.onap.so.beans.nsmf.NetworkType.CORE; @RunWith(SpringRunner.class) public class NssmfAdapterControllerTest { diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/entity/RestResponseTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/entity/RestResponseTest.java index d80359d..afda23e 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/entity/RestResponseTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/entity/RestResponseTest.java @@ -24,7 +24,8 @@ import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringRunner; import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; @RunWith(SpringRunner.class) public class RestResponseTest { diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/exceptions/ApplicationExceptionTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/exceptions/ApplicationExceptionTest.java index 27043bb..ae83006 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/exceptions/ApplicationExceptionTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/exceptions/ApplicationExceptionTest.java @@ -24,7 +24,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; @RunWith(SpringRunner.class) public class ApplicationExceptionTest { diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java index 6bb70ea..df49953 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java @@ -27,8 +27,6 @@ import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.conn.util.DomainType; -import org.ehcache.config.ResourceType; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -43,17 +41,41 @@ import org.onap.so.adapters.nssmf.enums.ActionType; import org.onap.so.adapters.nssmf.enums.HttpMethod; import org.onap.so.adapters.nssmf.exceptions.ApplicationException; import org.onap.so.adapters.nssmf.util.RestUtil; -import org.onap.so.beans.nsmf.*; +import org.onap.so.beans.nsmf.ActDeActNssi; +import org.onap.so.beans.nsmf.AllocateAnNssi; +import org.onap.so.beans.nsmf.AllocateCnNssi; +import org.onap.so.beans.nsmf.AllocateTnNssi; +import org.onap.so.beans.nsmf.AnSliceProfile; +import org.onap.so.beans.nsmf.ConnectionLink; +import org.onap.so.beans.nsmf.CnSliceProfile; +import org.onap.so.beans.nsmf.DeAllocateNssi; +import org.onap.so.beans.nsmf.EsrInfo; +import org.onap.so.beans.nsmf.JobStatusResponse; +import org.onap.so.beans.nsmf.PerfReq; +import org.onap.so.beans.nsmf.PerfReqEmbb; +import org.onap.so.beans.nsmf.QuerySubnetCapability; +import org.onap.so.beans.nsmf.NetworkType; +import org.onap.so.beans.nsmf.NsiInfo; +import org.onap.so.beans.nsmf.NssiResponse; +import org.onap.so.beans.nsmf.NssmfAdapterNBIRequest; +import org.onap.so.beans.nsmf.NssmfRequest; +import org.onap.so.beans.nsmf.ResponseDescriptor; +import org.onap.so.beans.nsmf.ServiceInfo; +import org.onap.so.beans.nsmf.TnSliceProfile; +import org.onap.so.beans.nsmf.TransportSliceNetwork; +import org.onap.so.beans.nsmf.UeMobilityLevel; import org.onap.so.db.request.beans.ResourceOperationStatus; import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; -import javax.persistence.Access; -import javax.persistence.ManyToOne; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.lang.reflect.Field; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -63,7 +85,9 @@ import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal; import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.unMarshal; -import static org.onap.so.beans.nsmf.NetworkType.*; +import static org.onap.so.beans.nsmf.NetworkType.ACCESS; +import static org.onap.so.beans.nsmf.NetworkType.CORE; +import static org.onap.so.beans.nsmf.NetworkType.TRANSPORT; import static org.onap.so.beans.nsmf.ResourceSharingLevel.NON_SHARED; @RunWith(SpringRunner.class) diff --git a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/util/RestUtilTest.java b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/util/RestUtilTest.java index 5d07c5e..2d1174c 100644 --- a/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/util/RestUtilTest.java +++ b/so-nssmf-adapter-application/src/test/java/org/onap/so/adapters/nssmf/util/RestUtilTest.java @@ -19,24 +19,17 @@ */ package org.onap.so.adapters.nssmf.util; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpRequestBase; -import org.hibernate.jdbc.Expectations; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.mockito.Spy; -import org.mockito.stubbing.Answer; import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.so.adapters.nssmf.entity.NssmfInfo; import org.onap.so.adapters.nssmf.entity.RestResponse; import org.onap.so.adapters.nssmf.enums.HttpMethod; import org.onap.so.adapters.nssmf.exceptions.ApplicationException; @@ -47,11 +40,10 @@ import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; -import java.util.Optional; import static org.junit.Assert.assertNotNull; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; -import static org.mockito.MockitoAnnotations.initMocks; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.when; import static org.onap.so.beans.nsmf.NetworkType.CORE; @RunWith(SpringRunner.class) -- cgit 1.2.3-korg