Bump to Silicon
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / service / PathComputationServiceImplTest.java
index df4e006e0d06965ccc700de4ca6a48875cec66a5..86a2f9e075123269c73fb1aa05b6b6a5cb7c52f7 100644 (file)
@@ -15,7 +15,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.transportpce.common.DataStoreContext;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 import org.opendaylight.transportpce.common.network.RequestProcessor;
@@ -25,17 +24,18 @@ import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.pce.utils.PceTestUtils;
 import org.opendaylight.transportpce.pce.utils.TransactionUtils;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.PathBandwidth;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.PathPropertiesBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathMetric;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.generic.path.properties.path.properties.PathMetricBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.no.path.info.NoPathBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.Response;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.ResponseBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.NoPathCaseBuilder;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.result.response.response.type.PathCaseBuilder;
-
-
+import org.opendaylight.transportpce.test.DataStoreContext;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.PathBandwidth;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.PathPropertiesBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.path.properties.PathMetric;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.path.properties.PathMetricBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.no.path.info.NoPathBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.Response;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.ResponseBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.ResponseKey;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.response.response.type.NoPathCaseBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.result.response.response.type.PathCaseBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class PathComputationServiceImplTest extends AbstractTest {
 
@@ -53,7 +53,7 @@ public class PathComputationServiceImplTest extends AbstractTest {
         gnpyResult = Mockito.mock(GnpyResult.class);
         pathComputationServiceImpl = new PathComputationServiceImpl(
                 networkTransactionService,
-                this.getNotificationPublishService());
+                this.getNotificationPublishService(), null);
         pathComputationServiceImpl.init();
     }
 
@@ -67,7 +67,8 @@ public class PathComputationServiceImplTest extends AbstractTest {
 
     @Test
     public void testPathComputationRequestNoPath() {
-        Response response = new ResponseBuilder().setResponseType(new NoPathCaseBuilder()
+        Response response = new ResponseBuilder()
+                .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new NoPathCaseBuilder()
                 .setNoPath(new NoPathBuilder().setNoPath("no path").build()).build()).build();
 
         pathComputationServiceImpl.generateGnpyResponse(response,"path");
@@ -81,7 +82,8 @@ public class PathComputationServiceImplTest extends AbstractTest {
         PathMetric pathMetric = new PathMetricBuilder()
                 .setAccumulativeValue(new BigDecimal(21))
                 .setMetricType(PathBandwidth.class).build();
-        Response response = new ResponseBuilder().setResponseType(new PathCaseBuilder()
+        Response response = new ResponseBuilder()
+                .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new PathCaseBuilder()
                 .setPathProperties(new PathPropertiesBuilder().setPathMetric(Map.of(pathMetric.key(),pathMetric))
                 .build()).build()).build();
 
@@ -97,7 +99,7 @@ public class PathComputationServiceImplTest extends AbstractTest {
         GnpyResult gnpyResult2 =
                 new GnpyResult("A-to-Z",
                         new GnpyTopoImpl(new NetworkTransactionImpl(
-                                new RequestProcessor(dataBroker))));
+                                new RequestProcessor(dataBroker))), null);
         pathComputationServiceImpl.generateGnpyResponse(gnpyResult2.getResponse(), "A-to-Z");
     }