X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Futils%2FPceTestUtils.java;h=00701404185194c8f5fdc67ddbf380edf5d09c41;hb=abb6dfc9107e5aa337a51143bcbf7f1393b3c8ce;hp=b12f399988511918a6564da753229ac4f5e726b6;hpb=82610815f1b706e2f9b5e5578474f3a8205c41aa;p=transportpce.git diff --git a/pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestUtils.java b/pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestUtils.java index b12f39998..007014041 100644 --- a/pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestUtils.java +++ b/pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestUtils.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; - import org.junit.Assert; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; @@ -21,10 +20,9 @@ import org.opendaylight.transportpce.binding.converter.XMLDataObjectConverter; import org.opendaylight.transportpce.binding.converter.api.DataObjectConverter; import org.opendaylight.transportpce.common.NetworkUtils; import org.opendaylight.transportpce.test.common.DataStoreContext; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestOutput; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.atoz.direction.AToZ; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.Node; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.pce.resource.resource.resource.node.NodeIdentifier; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.atoz.direction.AToZ; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.pce.resource.resource.resource.Node; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkId; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkKey; @@ -124,15 +122,12 @@ public final class PceTestUtils { return false; } return aToZ.getResource().getResource() instanceof Node; - }).filter(aToZ -> { + }).map(aToZ -> { Node node = (Node) aToZ.getResource().getResource(); - if (node.getNodeIdentifier() == null) { + if (node.getNodeId() == null) { LOG.warn("Node in AToZ node {} contains null! Skipping this node!", aToZ.getId()); - return false; + return null; } - return true; - }).map(aToZ -> { - NodeIdentifier node = ((Node) aToZ.getResource().getResource()).getNodeIdentifier(); return node.getNodeId().toString(); }).collect(Collectors.toList()); }