aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test
diff options
context:
space:
mode:
authorArindam Mondal <arind.mondal@samsung.com>2019-04-23 13:39:56 +0900
committerarindamm <arind.mondal@samsung.com>2019-04-23 17:21:57 +0900
commitf3d868d103e9d3a41bc1e8bea443271745d5abcf (patch)
tree14b959c70cebd05c67b9f1c1574be3ba9244d9a3 /vid-app-common/src/test
parente6571c6df02776c335b156b0fb44e31d723ffa06 (diff)
Sonar fix too many method param
Issue-ID: VID-466 Change-Id: I5fbffdddabf9f62a5408cd8b40397a42753006e8 Signed-off-by: arindamm <arind.mondal@samsung.com>
Diffstat (limited to 'vid-app-common/src/test')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientITTest.java64
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java3
2 files changed, 36 insertions, 31 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientITTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientITTest.java
index 12a327af8..126f30067 100644
--- a/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientITTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/rest/SdcRestClientITTest.java
@@ -20,8 +20,25 @@
package org.onap.vid.asdc.rest;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.xebialabs.restito.semantics.Call;
+import static com.xebialabs.restito.semantics.Action.ok;
+import static com.xebialabs.restito.semantics.Action.stringContent;
+import static org.apache.http.client.config.RequestConfig.custom;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.matchesPattern;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+import static org.junit.Assert.assertTrue;
+import static org.onap.vid.client.SyncRestClientInterface.HEADERS.X_ECOMP_INSTANCE_ID;
+import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.GeneralSecurityException;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.UUID;
+import javax.net.ssl.SSLContext;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
@@ -38,27 +55,8 @@ import org.onap.vid.asdc.AsdcCatalogException;
import org.onap.vid.asdc.beans.Service;
import org.onap.vid.client.SyncRestClient;
import org.onap.vid.testUtils.StubServerUtil;
-
-import javax.net.ssl.SSLContext;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.security.GeneralSecurityException;
-import java.util.Collections;
-import java.util.Optional;
-import java.util.UUID;
-
-import static com.xebialabs.restito.semantics.Action.ok;
-import static com.xebialabs.restito.semantics.Action.stringContent;
-import static org.apache.http.client.config.RequestConfig.custom;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.matchesPattern;
-import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
-import static org.junit.Assert.assertTrue;
-import static org.onap.vid.client.SyncRestClientInterface.HEADERS.X_ECOMP_INSTANCE_ID;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.xebialabs.restito.semantics.Call;
public class SdcRestClientITTest {
@@ -124,15 +122,23 @@ public class SdcRestClientITTest {
assertTrue(first.isPresent());
- assertThat(first.get().getHeaders().keySet(), hasItems(X_ECOMP_INSTANCE_ID.toLowerCase(), REQUEST_ID_HEADER_KEY.toLowerCase()));
- assertThat(first.get().getHeaders().get(REQUEST_ID_HEADER_KEY.toLowerCase()).get(0), matchesPattern(UUID_REGEX));
+ assertThat(first.get().getHeaders().keySet(),
+ hasItems(X_ECOMP_INSTANCE_ID.toLowerCase(), REQUEST_ID_HEADER_KEY.toLowerCase()));
+ assertThat(first.get().getHeaders().get(REQUEST_ID_HEADER_KEY.toLowerCase()).get(0),
+ matchesPattern(UUID_REGEX));
}
private Service getExpectedService(String stringId) {
- return new Service(stringId, stringId,
- "sampleCategory", "sampleVersion",
- "sampleName", "sampleDistStatus",
- "sampleToscaUrl", Service.LifecycleState.CERTIFIED, Collections.emptyList(), Collections.emptyList());
+ return new Service.ServiceBuilder().setUuid(stringId)
+ .setInvariantUUID(stringId)
+ .setCategory("sampleCategory")
+ .setVersion("sampleVersion")
+ .setName( "sampleName")
+ .setDistributionStatus("sampleDistStatus")
+ .setToscaModelURL("sampleToscaUrl")
+ .setLifecycleState(Service.LifecycleState.CERTIFIED)
+ .setArtifacts(Collections.emptyList())
+ .setResources(Collections.emptyList()).build();
}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java
index 2c6963147..39d3cddc7 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java
@@ -35,7 +35,6 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.onap.vid.asdc.AsdcCatalogException;
import org.onap.vid.asdc.beans.SecureServices;
import org.onap.vid.asdc.beans.Service;
-import org.onap.vid.asdc.beans.ServiceBuilder;
import org.onap.vid.model.*;
import org.onap.vid.model.PombaInstance.PombaRequest;
import org.onap.vid.model.PombaInstance.ServiceInstance;
@@ -171,7 +170,7 @@ public class VidControllerTest {
}
private Service createService(String uuid, int i) {
- return new ServiceBuilder().setUuid(uuid).setInvariantUUID("invariantUUID" + i)
+ return new Service.ServiceBuilder().setUuid(uuid).setInvariantUUID("invariantUUID" + i)
.setCategory("category" + i).setVersion("version" + i).setName("name" + i)
.setDistributionStatus("distStatus" + i).setToscaModelURL("toscaModelUrl" + i).build();
}