summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBOSLET <cb645j@att.com>2020-07-15 15:00:58 -0500
committerBoslet, Cory (cb645j) <cb645j@att.com>2020-07-17 17:21:11 -0500
commit4ea22cc961c56de0a8e2bd18932a316810edfa09 (patch)
treede14bd66eaa3a42a0f486a27824b9eddcf87dc84
parentefdc7c5697a5c3d1ccff4fe730e73cefcf694215 (diff)
Added Tags to the project pojo in keystone client.
Fixed the formatting and updated the UT so have values Issue-ID: SO-3071 Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fb384 Signed-off-by: Boslet, Cory (cb645j) <cb645j@att.com>
-rw-r--r--keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java11
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java12
2 files changed, 18 insertions, 5 deletions
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java
index 2f76faf..ef64152 100644
--- a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java
@@ -16,6 +16,7 @@
package com.woorea.openstack.keystone.v3.model;
+import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -31,6 +32,8 @@ public class Project {
private Boolean enabled;
+ private List<String> tags;
+
public String getId() {
return id;
}
@@ -63,4 +66,12 @@ public class Project {
this.enabled = enabled;
}
+ public List<String> getTags() {
+ return tags;
+ }
+
+ public void setTags(List<String> tags) {
+ this.tags = tags;
+ }
+
}
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java
index f6a267e..f4d93c8 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java
@@ -20,15 +20,15 @@
package com.woorea.openstack.keystone.v3.model;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
public class ProjectsTest {
@@ -37,7 +37,8 @@ public class ProjectsTest {
private static final String JSON_FULL = "{" + EOL + " \"projects\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ " \"name\" : \"name\"," + EOL + " \"enabled\" : false," + EOL + " \"domain_id\" : \"domainid\""
+ EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"," + EOL
- + " \"enabled\" : false," + EOL + " \"domain_id\" : \"domainid\"" + EOL + " } ]" + EOL + "}";
+ + " \"enabled\" : false," + EOL + " \"domain_id\" : \"domainid\"," + EOL
+ + " \"tags\" : [\"someTag\"]" + EOL + " } ]" + EOL + "}";
private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
.enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
@@ -61,6 +62,7 @@ public class ProjectsTest {
List<Project> list = projects.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
+ Assert.assertEquals("someTag", list.get(1).getTags().get(0));
int cnt = 0;
for (@SuppressWarnings("unused")