[ONOS-2225] Add unit test for Flow Objectives REST API
This commits add unit tests for Flow Objective REST API.
The corresponding REST API implementation can be referred to
e9ac2c50b963465b3210f4336bbe75c8436aeb59.
Change-Id: I018fdafe103b3eb14e06c162c47093a11d660b26
diff --git a/web/api/src/test/resources/org/onosproject/rest/post-filter-objective.json b/web/api/src/test/resources/org/onosproject/rest/post-filter-objective.json
new file mode 100644
index 0000000..665539d
--- /dev/null
+++ b/web/api/src/test/resources/org/onosproject/rest/post-filter-objective.json
@@ -0,0 +1,25 @@
+{
+ "priority": 1,
+ "isPermanent": false,
+ "deviceId": "of:0000000000000001",
+ "timeout": 1,
+ "type": "PERMIT",
+ "operation": "ADD",
+ "conditions": [
+ {
+ "type": "IN_PORT",
+ "port": 23
+ }
+ ],
+ "meta": {
+ "instructions": [
+ {
+ "type": "OUTPUT",
+ "port": -3
+ },
+ {
+ "type": "DROP"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/web/api/src/test/resources/org/onosproject/rest/post-forward-objective.json b/web/api/src/test/resources/org/onosproject/rest/post-forward-objective.json
new file mode 100644
index 0000000..634424d
--- /dev/null
+++ b/web/api/src/test/resources/org/onosproject/rest/post-forward-objective.json
@@ -0,0 +1,23 @@
+{
+ "priority": 1,
+ "isPermanent": false,
+ "timeout": 1,
+ "flag": "SPECIFIC",
+ "operation": "ADD",
+ "selector": {
+ "criteria": [
+ {
+ "type": "ETH_TYPE",
+ "ethType": "0x806"
+ }
+ ]
+ },
+ "treatment":
+ {
+ "instructions":
+ [
+ {"type":"OUTPUT","port":-3},
+ {"type":"DROP"}
+ ]
+ }
+}
\ No newline at end of file
diff --git a/web/api/src/test/resources/org/onosproject/rest/post-next-objective.json b/web/api/src/test/resources/org/onosproject/rest/post-next-objective.json
new file mode 100644
index 0000000..1b19216
--- /dev/null
+++ b/web/api/src/test/resources/org/onosproject/rest/post-next-objective.json
@@ -0,0 +1,26 @@
+{
+ "id": 1,
+ "type": "FAILOVER",
+ "operation": "ADD",
+ "treatments": [
+ {
+ "instructions": [
+ {
+ "type": "OUTPUT",
+ "port": -3
+ },
+ {
+ "type": "DROP"
+ }
+ ]
+ }
+ ],
+ "meta": {
+ "criteria": [
+ {
+ "type": "IN_PORT",
+ "port": 23
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/web/api/src/test/resources/org/onosproject/rest/post-objective-policy.json b/web/api/src/test/resources/org/onosproject/rest/post-objective-policy.json
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/web/api/src/test/resources/org/onosproject/rest/post-objective-policy.json