Fix ONOS-5091
Change-Id: I11762eb799c1f93536f472807167cdba20a7c8e6
(cherry picked from commit 45f806ccedf844dfc8fe1722eca653f274b83f12)
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java
index 385f399..1fa9618 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/GroupCodec.java
@@ -82,7 +82,7 @@
.put(DEVICE_ID, group.deviceId().toString());
if (group.appId() != null) {
- result.put(APP_ID, group.appId().toString());
+ result.put(APP_ID, group.appId().name());
}
if (group.appCookie() != null) {
diff --git a/web/api/src/main/resources/definitions/Group.json b/web/api/src/main/resources/definitions/Group.json
index 53d226e..a96125a 100644
--- a/web/api/src/main/resources/definitions/Group.json
+++ b/web/api/src/main/resources/definitions/Group.json
@@ -62,7 +62,7 @@
"appId": {
"type": "string",
"description": "application identifier",
- "example": "1"
+ "example": "org.onosproject.rest"
},
"appCookie": {
"type": "string",
diff --git a/web/api/src/main/resources/definitions/Groups.json b/web/api/src/main/resources/definitions/Groups.json
index 04273e0..50b6850 100644
--- a/web/api/src/main/resources/definitions/Groups.json
+++ b/web/api/src/main/resources/definitions/Groups.json
@@ -75,7 +75,7 @@
"appId": {
"type": "string",
"description": "application identifier",
- "example": "1"
+ "example": "org.onosproject.rest"
},
"appCookie": {
"type": "string",
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/GroupsResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/GroupsResourceTest.java
index 63a7daa..67cf11b 100644
--- a/web/api/src/test/java/org/onosproject/rest/resources/GroupsResourceTest.java
+++ b/web/api/src/test/java/org/onosproject/rest/resources/GroupsResourceTest.java
@@ -280,9 +280,9 @@
// check application id
final String jsonAppId = jsonGroup.get("appId").asString();
- final String appId = group.appId().toString();
+ final String appId = group.appId().name();
if (!jsonAppId.equals(appId)) {
- reason = "appId " + group.appId().toString();
+ reason = "appId " + group.appId().name();
return false;
}