Inherit Intent Key on compilation
- Added Intent#key() method description
- Inherit key field from parent Intent during Intent
compilation process
- Added assertion to existing unit tests
Change-Id: Iff85c5ec448b3f378957b7a20af865ad96cc3216
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
index 02b8865..a6fac6f 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java
@@ -256,6 +256,7 @@
createFailoverTreatmentGroup(path.links(), path.backup().links(), intent);
FlowRuleIntent frIntent = new FlowRuleIntent(intent.appId(),
+ intent.key(),
createFailoverFlowRules(intent),
asList(ingressPoint.deviceId()),
PathIntent.ProtectionType.FAILOVER);
@@ -312,6 +313,7 @@
PathIntent.ProtectionType type) {
return PathIntent.builder()
.appId(intent.appId())
+ .key(intent.key())
.selector(intent.selector())
.treatment(intent.treatment())
.path(path)