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/PathIntentFlowObjectiveCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentFlowObjectiveCompiler.java
index 3f0fc19..521d6fc 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentFlowObjectiveCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentFlowObjectiveCompiler.java
@@ -89,7 +89,11 @@
List<DeviceId> devices = new LinkedList<>();
compile(this, intent, objectives, devices);
- return ImmutableList.of(new FlowObjectiveIntent(appId, devices, objectives, intent.resources()));
+ return ImmutableList.of(new FlowObjectiveIntent(appId,
+ intent.key(),
+ devices,
+ objectives,
+ intent.resources()));
}
@Override