Remove deprecated instructions() method in the traffic treatment class
Change-Id: I739b35bdcbf9867c639c7b6ca4006f3eeafbb055
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
index 786c461..23dae38 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
@@ -36,12 +36,17 @@
final ObjectNode result = context.mapper().createObjectNode();
final ArrayNode jsonInstructions = result.putArray("instructions");
- if (treatment.instructions() != null) {
- final JsonCodec<Instruction> instructionCodec =
- context.codec(Instruction.class);
- for (final Instruction instruction : treatment.instructions()) {
- jsonInstructions.add(instructionCodec.encode(instruction, context));
- }
+ final JsonCodec<Instruction> instructionCodec =
+ context.codec(Instruction.class);
+
+ for (final Instruction instruction : treatment.immediate()) {
+ jsonInstructions.add(instructionCodec.encode(instruction, context));
+ }
+
+ final ArrayNode jsonDeferred = result.putArray("deferred");
+
+ for (final Instruction instruction : treatment.deferred()) {
+ jsonDeferred.add(instructionCodec.encode(instruction, context));
}
return result;
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 5ae8f20..d30999d 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
@@ -370,7 +370,7 @@
// check treatment
final JsonNode jsonTreatment = jsonIntent.get("treatment");
final TrafficTreatment treatment = connectivityIntent.treatment();
- final List<Instruction> instructions = treatment.instructions();
+ final List<Instruction> instructions = treatment.immediate();
final JsonNode jsonInstructions = jsonTreatment.get("instructions");
if (jsonInstructions.size() != instructions.size()) {
description.appendText("size of instructions array is "