Implant vid-app-common org.onap.vid.job (main and test)
[vid.git] / vid-app-common / src / test / java / org / onap / vid / controller / VidControllerTest.java
index aeb03b6..484f4a0 100644 (file)
@@ -2,14 +2,14 @@
  * ============LICENSE_START=======================================================
  * VID
  * ================================================================================
- * Modifications Copyright 2018 Nokia
+ * Modifications Copyright 2018 - 2019 Nokia
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *      http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -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;
@@ -151,8 +150,7 @@ public class VidControllerTest {
 
     @Test
     public void verifyServiceInstance_shouldReturnOk() throws Exception {
-        PombaRequest pombaRequest = new PombaRequest();
-        pombaRequest.serviceInstanceList = ImmutableList.of(new ServiceInstance());
+        PombaRequest pombaRequest = new PombaRequest(ImmutableList.of(new ServiceInstance()));
 
         mockMvc.perform(post(REST_MODELS_SERVICES_VERIFY_SERVICE)
             .contentType(MediaType.APPLICATION_JSON)
@@ -172,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();
     }
@@ -180,7 +178,7 @@ public class VidControllerTest {
     private ServiceModel createServiceModel(int i) {
         ServiceModel model = new ServiceModel();
 
-        model.setCollectionResource(ImmutableMap.of("resKey" + i, new CR()));
+        model.setCollectionResources(ImmutableMap.of("resKey" + i, new CR()));
         model.setNetworks(ImmutableMap.of("network" + i, new Network()));
         model.setPnfs(ImmutableMap.of("pnf" + i, new Node()));
         model.setServiceProxies(ImmutableMap.of("servProxy" + i, new ServiceProxy()));
@@ -201,4 +199,4 @@ public class VidControllerTest {
         return IntStream.range(0, pseudoServiceModels.size()).boxed()
             .collect(toMap(i -> uuids.get(i), i -> pseudoServiceModels.get(i)));
     }
-}
\ No newline at end of file
+}