Refactor PCE network analyzer PceOtnNode step 9
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / service / PathComputationServiceImplTest.java
index 0ab6d1c1e1227526f53eeb798889bba2b26ee2d5..c021fe29fd970576c95e71ceb1cf1a9157499532 100644 (file)
@@ -21,17 +21,16 @@ import org.opendaylight.transportpce.pce.gnpy.GnpyTopoImpl;
 import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.test.AbstractTest;
 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;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.PathBandwidth;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.generic.path.properties.PathPropertiesBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.generic.path.properties.path.properties.PathMetric;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.generic.path.properties.path.properties.PathMetricBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.no.path.info.NoPathBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.Response;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.ResponseBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.ResponseKey;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.response.response.type.NoPathCaseBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.response.response.type.PathCaseBuilder;
 
 public class PathComputationServiceImplTest extends AbstractTest {
 
@@ -39,8 +38,8 @@ public class PathComputationServiceImplTest extends AbstractTest {
     private static NetworkTransactionService networkTransactionService = null;
     private static GnpyTopoImpl gnpyTopoImpl = null;
     private static GnpyResult gnpyResult = null;
-    private DataStoreContext dataStoreContext = this.getDataStoreContextUtil();
-    private DataBroker dataBroker = this.getDataBroker();
+    private DataStoreContext dataStoreContext = getDataStoreContextUtil();
+    private DataBroker dataBroker = getDataBroker();
 
     @Before
     public void setUp() {
@@ -49,7 +48,7 @@ public class PathComputationServiceImplTest extends AbstractTest {
         gnpyResult = Mockito.mock(GnpyResult.class);
         pathComputationServiceImpl = new PathComputationServiceImpl(
                 networkTransactionService,
-                this.getNotificationPublishService(), null);
+                this.getNotificationPublishService(), null, null);
         pathComputationServiceImpl.init();
     }
 
@@ -64,7 +63,7 @@ public class PathComputationServiceImplTest extends AbstractTest {
     @Test
     public void testPathComputationRequestNoPath() {
         Response response = new ResponseBuilder()
-                .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new NoPathCaseBuilder()
+                .withKey(new ResponseKey("responseId")).setResponseType(new NoPathCaseBuilder()
                 .setNoPath(new NoPathBuilder().setNoPath("no path").build()).build()).build();
 
         pathComputationServiceImpl.generateGnpyResponse(response,"path");
@@ -79,7 +78,7 @@ public class PathComputationServiceImplTest extends AbstractTest {
                 .setAccumulativeValue(new BigDecimal(21))
                 .setMetricType(PathBandwidth.class).build();
         Response response = new ResponseBuilder()
-                .withKey(new ResponseKey(Uint32.valueOf(1))).setResponseType(new PathCaseBuilder()
+                .withKey(new ResponseKey("responseId")).setResponseType(new PathCaseBuilder()
                 .setPathProperties(new PathPropertiesBuilder().setPathMetric(Map.of(pathMetric.key(),pathMetric))
                 .build()).build()).build();