Avoid double wrap of IndexedLambda
Change-Id: I2acaa255529949e8443542904df465e6b0fbb72a
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/ConstraintCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/ConstraintCodecTest.java
index 48c4817..a84dab4 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/ConstraintCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/ConstraintCodecTest.java
@@ -146,7 +146,7 @@
assertThat(constraint, instanceOf(LambdaConstraint.class));
LambdaConstraint lambdaConstraint = (LambdaConstraint) constraint;
- assertThat(lambdaConstraint.lambda().toInt(), is(444));
+ assertThat(lambdaConstraint.lambda().index(), is(444L));
}
/**
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
index 0c2f097..596c7ef 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/IntentCodecTest.java
@@ -63,7 +63,6 @@
import org.onosproject.net.intent.constraint.LatencyConstraint;
import org.onosproject.net.intent.constraint.ObstacleConstraint;
import org.onosproject.net.intent.constraint.WaypointConstraint;
-import org.onosproject.net.resource.link.LambdaResource;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -181,7 +180,7 @@
final List<Constraint> constraints =
ImmutableList.of(
new BandwidthConstraint(Bandwidth.bps(1.0)),
- new LambdaConstraint(LambdaResource.valueOf(3)),
+ new LambdaConstraint(new IndexedLambda(3)),
new AnnotationConstraint("key", 33.0),
new AsymmetricPathConstraint(),
new LatencyConstraint(Duration.ofSeconds(2)),
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/IntentJsonMatcher.java b/core/common/src/test/java/org/onosproject/codec/impl/IntentJsonMatcher.java
index 3adfcff..acc1f0e 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/IntentJsonMatcher.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/IntentJsonMatcher.java
@@ -157,7 +157,7 @@
final JsonNode lambdaJson = constraintJson.get("lambda");
return lambdaJson != null
&& constraintJson.get("lambda").asInt()
- == lambdaConstraint.lambda().toInt();
+ == lambdaConstraint.lambda().index();
}
/**