summaryrefslogtreecommitdiffstats
path: root/keystone-model/src/test/java/com/woorea/openstack/keystone/v3
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-05-02 09:42:55 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-05-07 10:02:17 -0400
commit3f9a0c3183480d150089c0d5a6e507c877f7d121 (patch)
treeb3db04cbe2cef23f81503177a50edc5360ffa486 /keystone-model/src/test/java/com/woorea/openstack/keystone/v3
parente153f0adfbed711ce1e215748594a4d04fd1edaf (diff)
Enhance Openstack Client
Update Openstack Client to support additional fields Updat all formatting issues Issue-ID: SO-1844 Change-Id: I1369e0c18cc25274db8df7e12855a020b8da38da Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'keystone-model/src/test/java/com/woorea/openstack/keystone/v3')
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/AuthenticationTest.java57
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialTest.java41
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialsTest.java45
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainTest.java21
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainsTest.java35
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointTest.java32
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointsTest.java35
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupTest.java31
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupsTest.java35
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/IdentityTest.java39
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PasswordTest.java26
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PoliciesTest.java45
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PolicyTest.java41
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectTest.java26
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectsTest.java34
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RoleTest.java9
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RolesTest.java35
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ScopeTest.java24
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServiceTest.java43
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServicesTest.java35
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/TokenTest.java118
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UserTest.java47
-rw-r--r--keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UsersTest.java43
23 files changed, 296 insertions, 601 deletions
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/AuthenticationTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/AuthenticationTest.java
index 2779e1b..8fdaf88 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/AuthenticationTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/AuthenticationTest.java
@@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
import com.woorea.openstack.keystone.v3.model.Authentication.Scope;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,45 +35,21 @@ public class AuthenticationTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"auth\" : {" + EOL
- + " \"identity\" : {" + EOL
- + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL
- + " \"password\" : {" + EOL
- + " \"user\" : {" + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"password\" : \"password\"" + EOL
- + " }" + EOL
- + " }," + EOL
- + " \"token\" : {" + EOL
- + " \"id\" : \"id\"" + EOL
- + " }" + EOL
- + " }," + EOL
- + " \"scope\" : {" + EOL
- + " \"project\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }" + EOL
- + " }" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"auth\" : {" + EOL + " \"identity\" : {" + EOL
+ + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL + " \"password\" : {" + EOL
+ + " \"user\" : {" + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"password\" : \"password\"" + EOL + " }" + EOL
+ + " }," + EOL + " \"token\" : {" + EOL + " \"id\" : \"id\"" + EOL + " }" + EOL
+ + " }," + EOL + " \"scope\" : {" + EOL + " \"project\" : {" + EOL + " \"id\" : \"id\","
+ + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"name\" : \"name\"" + EOL
+ + " }" + EOL + " }" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -90,11 +65,11 @@ public class AuthenticationTest {
public void testMethods() throws Exception {
Authentication authentication = objectMapper.readValue(JSON_FULL, Authentication.class);
authentication.toString();
-
+
Identity identity = authentication.getIdentity();
Assert.assertNotNull(identity);
authentication.setIdentity(identity);
-
+
Scope scope = authentication.getScope();
Assert.assertNotNull(scope);
authentication.setScope(scope);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialTest.java
index aaa2725..55f4774 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialTest.java
@@ -24,9 +24,7 @@ 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.Map;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,26 +34,15 @@ public class CredentialTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"credential\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"credential\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -71,24 +58,24 @@ public class CredentialTest {
public void testMethods() throws Exception {
Credential credential = objectMapper.readValue(JSON_FULL, Credential.class);
credential.toString();
-
- Map<String,String> blob = credential.getBlob();
+
+ Map<String, String> blob = credential.getBlob();
Assert.assertNotNull(blob);
Assert.assertEquals(2, blob.size());
credential.setBlob(blob);
-
+
String id = credential.getId();
Assert.assertNotNull(id);
credential.setId(id);
-
+
String type = credential.getType();
Assert.assertNotNull(type);
credential.setType(type);
-
+
String userId = credential.getUserId();
Assert.assertNotNull(userId);
credential.setUserId(userId);
-
+
String projectId = credential.getProjectId();
Assert.assertNotNull(projectId);
credential.setProjectId(projectId);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialsTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialsTest.java
index a2e2e52..5aca3fc 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialsTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/CredentialsTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,33 +34,17 @@ public class CredentialsTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"credentials\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"credentials\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -78,13 +60,14 @@ public class CredentialsTest {
public void testMethods() throws Exception {
Credentials credentials = objectMapper.readValue(JSON_FULL, Credentials.class);
credentials.toString();
-
+
List<Credential> list = credentials.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Credential x : credentials) {
+ for (@SuppressWarnings("unused")
+ Credential x : credentials) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainTest.java
index f2ea79a..895d2b0 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainTest.java
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Token.Domain;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -35,16 +34,12 @@ public class DomainTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + "}";
-
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private static final String JSON_FULL =
+ "{" + EOL + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"" + EOL + "}";
+
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -60,11 +55,11 @@ public class DomainTest {
public void testMethods() throws Exception {
Domain domain = objectMapper.readValue(JSON_FULL, Domain.class);
domain.toString();
-
+
String name = domain.getName();
Assert.assertNotNull(name);
domain.setName(name);
-
+
String id = domain.getId();
Assert.assertNotNull(id);
domain.setId(id);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainsTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainsTest.java
index e517ff7..0fabf5e 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainsTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/DomainsTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,25 +34,15 @@ public class DomainsTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"domains\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"enabled\" : false" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"enabled\" : false" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"domains\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"enabled\" : false" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"enabled\" : false" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -70,13 +58,14 @@ public class DomainsTest {
public void testMethods() throws Exception {
Domains domains = objectMapper.readValue(JSON_FULL, Domains.class);
domains.toString();
-
+
List<Domain> list = domains.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Domain x : domains) {
+ for (@SuppressWarnings("unused")
+ Domain x : domains) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointTest.java
index 91807cf..0381510 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointTest.java
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Token.Service.Endpoint;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -35,20 +34,13 @@ public class EndpointTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL
+ + " \"region\" : \"region\"," + EOL + " \"enabled\" : false," + EOL + " \"interface\" : \"interface\","
+ + EOL + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -64,27 +56,27 @@ public class EndpointTest {
public void testMethods() throws Exception {
Endpoint endpoint = objectMapper.readValue(JSON_FULL, Endpoint.class);
endpoint.toString();
-
+
String legacyEndpointId = endpoint.getLegacyEndpointId();
Assert.assertNotNull(legacyEndpointId);
endpoint.setLegacyEndpointId(legacyEndpointId);
-
+
String id = endpoint.getId();
Assert.assertNotNull(id);
endpoint.setId(id);
-
+
String region = endpoint.getRegion();
Assert.assertNotNull(region);
endpoint.setRegion(region);
-
+
String interfaceProperty = endpoint.getInterface();
Assert.assertNotNull(interfaceProperty);
endpoint.setInterface(interfaceProperty);
-
+
String url = endpoint.getUrl();
Assert.assertNotNull(url);
endpoint.setUrl(url);
-
+
Boolean enabled = endpoint.getEnabled();
Assert.assertNotNull(enabled);
endpoint.setEnabled(enabled);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointsTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointsTest.java
index ef75d1b..df22f86 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointsTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/EndpointsTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,25 +34,15 @@ public class EndpointsTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"endpoints\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"service_id\" : \"serviceid\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"service_id\" : \"serviceid\"" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"endpoints\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"interface\" : \"interface\"," + EOL
+ + " \"service_id\" : \"serviceid\"" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"interface\" : \"interface\"," + EOL
+ + " \"service_id\" : \"serviceid\"" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -70,13 +58,14 @@ public class EndpointsTest {
public void testMethods() throws Exception {
Endpoints endpoints = objectMapper.readValue(JSON_FULL, Endpoints.class);
endpoints.toString();
-
+
List<Endpoint> list = endpoints.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Endpoint x : endpoints) {
+ for (@SuppressWarnings("unused")
+ Endpoint x : endpoints) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupTest.java
index f9ee0a4..4f553f1 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupTest.java
@@ -24,7 +24,6 @@ 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 org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -34,22 +33,14 @@ public class GroupTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"group\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"domain_id\" : \"domainid\"" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"group\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"domain_id\" : \"domainid\"" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -65,19 +56,19 @@ public class GroupTest {
public void testMethods() throws Exception {
Group group = objectMapper.readValue(JSON_FULL, Group.class);
group.toString();
-
+
String name = group.getName();
Assert.assertNotNull(name);
group.setName(name);
-
+
String description = group.getDescription();
Assert.assertNotNull(description);
group.setDescription(description);
-
+
String id = group.getId();
Assert.assertNotNull(id);
group.setId(id);
-
+
String domainId = group.getDomainId();
Assert.assertNotNull(domainId);
group.setDomainId(domainId);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupsTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupsTest.java
index eea955d..5d1a9a2 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupsTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/GroupsTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,25 +34,15 @@ public class GroupsTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"groups\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"domain_id\" : \"domainid\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"domain_id\" : \"domainid\"" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"groups\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"domain_id\" : \"domainid\"" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"domain_id\" : \"domainid\"" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -70,13 +58,14 @@ public class GroupsTest {
public void testMethods() throws Exception {
Groups groups = objectMapper.readValue(JSON_FULL, Groups.class);
groups.toString();
-
+
List<Group> list = groups.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Group x : groups) {
+ for (@SuppressWarnings("unused")
+ Group x : groups) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/IdentityTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/IdentityTest.java
index 799708f..0726544 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/IdentityTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/IdentityTest.java
@@ -27,9 +27,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity.Token;
-
import java.util.List;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -39,29 +37,16 @@ public class IdentityTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL
- + " \"password\" : {" + EOL
- + " \"user\" : {" + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"password\" : \"password\"" + EOL
- + " }" + EOL
- + " }," + EOL
- + " \"token\" : {" + EOL
- + " \"id\" : \"id\"" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL =
+ "{" + EOL + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL + " \"password\" : {" + EOL
+ + " \"user\" : {" + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"password\" : \"password\"" + EOL + " }" + EOL
+ + " }," + EOL + " \"token\" : {" + EOL + " \"id\" : \"id\"" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -77,16 +62,16 @@ public class IdentityTest {
public void testMethods() throws Exception {
Identity identity = objectMapper.readValue(JSON_FULL, Identity.class);
identity.toString();
-
+
Password password = identity.getPassword();
Assert.assertNotNull(password);
identity.setPassword(password);
-
+
List<String> methods = identity.getMethods();
Assert.assertNotNull(methods);
Assert.assertEquals(2, methods.size());
identity.setMethods(methods);
-
+
Token token = identity.getToken();
Assert.assertNotNull(token);
identity.setToken(token);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PasswordTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PasswordTest.java
index 4b2cd04..46ca89a 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PasswordTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PasswordTest.java
@@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password;
import com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password.User;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,23 +35,14 @@ public class PasswordTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"user\" : {" + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"password\" : \"password\"" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL =
+ "{" + EOL + " \"user\" : {" + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"password\" : \"password\"" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -68,7 +58,7 @@ public class PasswordTest {
public void testMethods() throws Exception {
Password password = objectMapper.readValue(JSON_FULL, Password.class);
password.toString();
-
+
User user = password.getUser();
Assert.assertNotNull(user);
password.setUser(user);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PoliciesTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PoliciesTest.java
index 3a8dc83..8d3096b 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PoliciesTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PoliciesTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,33 +34,17 @@ public class PoliciesTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"policies\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"policies\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -78,13 +60,14 @@ public class PoliciesTest {
public void testMethods() throws Exception {
Policies policies = objectMapper.readValue(JSON_FULL, Policies.class);
policies.toString();
-
+
List<Policy> list = policies.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Policy x : policies) {
+ for (@SuppressWarnings("unused")
+ Policy x : policies) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PolicyTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PolicyTest.java
index c4f7a73..50f7d8e 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PolicyTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/PolicyTest.java
@@ -24,9 +24,7 @@ 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.Map;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,26 +34,15 @@ public class PolicyTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"policy\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"projectId\" : \"projectid\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"userId\" : \"userid\"," + EOL
- + " \"blob\" : {" + EOL
- + " \"blob-k1\" : \"blob-v1\"," + EOL
- + " \"blob-k2\" : \"blob-v2\"" + EOL
- + " }" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"policy\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"projectId\" : \"projectid\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"userId\" : \"userid\"," + EOL + " \"blob\" : {" + EOL + " \"blob-k1\" : \"blob-v1\"," + EOL
+ + " \"blob-k2\" : \"blob-v2\"" + EOL + " }" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -71,24 +58,24 @@ public class PolicyTest {
public void testMethods() throws Exception {
Policy policy = objectMapper.readValue(JSON_FULL, Policy.class);
policy.toString();
-
- Map<String,String> blob = policy.getBlob();
+
+ Map<String, String> blob = policy.getBlob();
Assert.assertNotNull(blob);
Assert.assertEquals(2, blob.size());
policy.setBlob(blob);
-
+
String id = policy.getId();
Assert.assertNotNull(id);
policy.setId(id);
-
+
String type = policy.getType();
Assert.assertNotNull(type);
policy.setType(type);
-
+
String userId = policy.getUserId();
Assert.assertNotNull(userId);
policy.setUserId(userId);
-
+
String projectId = policy.getProjectId();
Assert.assertNotNull(projectId);
policy.setProjectId(projectId);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectTest.java
index 5526ad1..c040dd0 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ProjectTest.java
@@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Token.Domain;
import com.woorea.openstack.keystone.v3.model.Token.Project;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,20 +35,13 @@ public class ProjectTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + "}";
+ private static final String JSON_FULL =
+ "{" + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"" + EOL
+ + " }," + EOL + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -65,15 +57,15 @@ public class ProjectTest {
public void testMethods() throws Exception {
Project project = objectMapper.readValue(JSON_FULL, Project.class);
project.toString();
-
+
Domain domain = project.getDomain();
Assert.assertNotNull(domain);
project.setDomain(domain);
-
+
String name = project.getName();
Assert.assertNotNull(name);
project.setName(name);
-
+
String id = project.getId();
Assert.assertNotNull(id);
project.setId(id);
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 3582a4a..f6a267e 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
@@ -24,9 +24,7 @@ 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;
@@ -36,25 +34,14 @@ public class ProjectsTest {
private static final String EOL = System.lineSeparator();
- 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
- + "}";
+ 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 + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -70,13 +57,14 @@ public class ProjectsTest {
public void testMethods() throws Exception {
Projects projects = objectMapper.readValue(JSON_FULL, Projects.class);
projects.toString();
-
+
List<Project> list = projects.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Project x : projects) {
+ for (@SuppressWarnings("unused")
+ Project x : projects) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RoleTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RoleTest.java
index ad39df2..5d4086f 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RoleTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RoleTest.java
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Token.Role;
-
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
@@ -34,11 +33,9 @@ public class RoleTest {
private static final String JSON_FULL = "{ }";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RolesTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RolesTest.java
index cd8fbde..a2d8cee 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RolesTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/RolesTest.java
@@ -24,9 +24,7 @@ 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;
@@ -36,25 +34,15 @@ public class RolesTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"roles\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"enabled\" : \"enabled\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"enabled\" : \"enabled\"" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"roles\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"enabled\" : \"enabled\"" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"," + EOL
+ + " \"enabled\" : \"enabled\"" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -70,13 +58,14 @@ public class RolesTest {
public void testMethods() throws Exception {
Roles roles = objectMapper.readValue(JSON_FULL, Roles.class);
roles.toString();
-
+
List<Role> list = roles.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Role x : roles) {
+ for (@SuppressWarnings("unused")
+ Role x : roles) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ScopeTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ScopeTest.java
index 6beedb5..e84180a 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ScopeTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ScopeTest.java
@@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Authentication.Scope;
import com.woorea.openstack.keystone.v3.model.Authentication.Scope.Project;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -36,22 +35,13 @@ public class ScopeTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"project\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"project\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"" + EOL + " },"
+ + EOL + " \"name\" : \"name\"" + EOL + " }" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -67,7 +57,7 @@ public class ScopeTest {
public void testMethods() throws Exception {
Scope scope = objectMapper.readValue(JSON_FULL, Scope.class);
scope.toString();
-
+
Project project = scope.getProject();
Assert.assertNotNull(project);
scope.setProject(project);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServiceTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServiceTest.java
index 5edf7d6..1c48c88 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServiceTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServiceTest.java
@@ -26,9 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.v3.model.Token.Service;
import com.woorea.openstack.keystone.v3.model.Token.Service.Endpoint;
-
import java.util.List;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -38,31 +36,18 @@ public class ServiceTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"endpoints\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL =
+ "{" + EOL + " \"id\" : \"id\"," + EOL + " \"type\" : \"type\"," + EOL + " \"endpoints\" : [ {" + EOL
+ + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL + " \"region\" : \"region\","
+ + EOL + " \"enabled\" : false," + EOL + " \"interface\" : \"interface\"," + EOL
+ + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL + " }, {" + EOL
+ + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL + " \"region\" : \"region\","
+ + EOL + " \"enabled\" : false," + EOL + " \"interface\" : \"interface\"," + EOL
+ + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -78,16 +63,16 @@ public class ServiceTest {
public void testMethods() throws Exception {
Service service = objectMapper.readValue(JSON_FULL, Service.class);
service.toString();
-
+
List<Endpoint> endpoints = service.getEndpoints();
Assert.assertNotNull(endpoints);
Assert.assertEquals(2, endpoints.size());
service.setEndpoints(endpoints);
-
+
String id = service.getId();
Assert.assertNotNull(id);
service.setId(id);
-
+
String type = service.getType();
Assert.assertNotNull(type);
service.setType(type);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServicesTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServicesTest.java
index 0a88d6a..1f24494 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServicesTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/ServicesTest.java
@@ -25,9 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.model.Service;
-
import java.util.List;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -37,25 +35,15 @@ public class ServicesTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"services\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"description\" : \"description\"" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL =
+ "{" + EOL + " \"services\" : [ {" + EOL + " \"id\" : \"id\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"description\" : \"description\"" + EOL + " }, {" + EOL
+ + " \"id\" : \"id\"," + EOL + " \"type\" : \"type\"," + EOL + " \"name\" : \"name\"," + EOL
+ + " \"description\" : \"description\"" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -71,13 +59,14 @@ public class ServicesTest {
public void testMethods() throws Exception {
Services services = objectMapper.readValue(JSON_FULL, Services.class);
services.toString();
-
+
List<Service> list = services.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") Service x : services) {
+ for (@SuppressWarnings("unused")
+ Service x : services) {
++cnt;
}
Assert.assertEquals(2, cnt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/TokenTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/TokenTest.java
index 4852e61..2677941 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/TokenTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/TokenTest.java
@@ -29,10 +29,8 @@ import com.woorea.openstack.keystone.v3.model.Token.Project;
import com.woorea.openstack.keystone.v3.model.Token.Role;
import com.woorea.openstack.keystone.v3.model.Token.Service;
import com.woorea.openstack.keystone.v3.model.Token.User;
-
import java.util.Calendar;
import java.util.List;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -42,76 +40,34 @@ public class TokenTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"token\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"project\" : {" + EOL
- + " \"domain\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"user\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"" + EOL
- + " }," + EOL
- + " \"roles\" : [ { }, { } ]," + EOL
- + " \"catalog\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"endpoints\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " } ]" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"type\" : \"type\"," + EOL
- + " \"endpoints\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"url\" : \"url\"," + EOL
- + " \"region\" : \"region\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"interface\" : \"interface\"," + EOL
- + " \"legacy_endpoint_id\" : \"legacyendpointid\"" + EOL
- + " } ]" + EOL
- + " } ]," + EOL
- + " \"expires_at\" : 1489752000000," + EOL
- + " \"issued_at\" : 1488456000000" + EOL
- + " }" + EOL
- + "}";
-
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private static final String JSON_FULL = "{" + EOL + " \"token\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"methods\" : [ \"methods-v1\", \"methods-v2\" ]," + EOL + " \"domain\" : {" + EOL
+ + " \"id\" : \"id\"," + EOL + " \"name\" : \"name\"" + EOL + " }," + EOL
+ + " \"project\" : {" + EOL + " \"domain\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"user\" : {" + EOL + " \"id\" : \"id\","
+ + EOL + " \"name\" : \"name\"" + EOL + " }," + EOL + " \"roles\" : [ { }, { } ]," + EOL
+ + " \"catalog\" : [ {" + EOL + " \"id\" : \"id\"," + EOL + " \"type\" : \"type\"," + EOL
+ + " \"endpoints\" : [ {" + EOL + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL
+ + " \"region\" : \"region\"," + EOL + " \"enabled\" : false," + EOL
+ + " \"interface\" : \"interface\"," + EOL + " \"legacy_endpoint_id\" : \"legacyendpointid\""
+ + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL
+ + " \"region\" : \"region\"," + EOL + " \"enabled\" : false," + EOL
+ + " \"interface\" : \"interface\"," + EOL + " \"legacy_endpoint_id\" : \"legacyendpointid\""
+ + EOL + " } ]" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL + " \"type\" : \"type\","
+ + EOL + " \"endpoints\" : [ {" + EOL + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\","
+ + EOL + " \"region\" : \"region\"," + EOL + " \"enabled\" : false," + EOL
+ + " \"interface\" : \"interface\"," + EOL + " \"legacy_endpoint_id\" : \"legacyendpointid\""
+ + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL + " \"url\" : \"url\"," + EOL
+ + " \"region\" : \"region\"," + EOL + " \"enabled\" : false," + EOL
+ + " \"interface\" : \"interface\"," + EOL + " \"legacy_endpoint_id\" : \"legacyendpointid\""
+ + EOL + " } ]" + EOL + " } ]," + EOL + " \"expires_at\" : 1489752000000," + EOL
+ + " \"issued_at\" : 1488456000000" + EOL + " }" + EOL + "}";
+
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -127,42 +83,42 @@ public class TokenTest {
public void testMethods() throws Exception {
Token token = objectMapper.readValue(JSON_FULL, Token.class);
token.toString();
-
+
List<String> methods = token.getMethods();
Assert.assertNotNull(methods);
Assert.assertEquals(2, methods.size());
token.setMethods(methods);
-
+
List<Service> catalog = token.getCatalog();
Assert.assertNotNull(catalog);
Assert.assertEquals(2, catalog.size());
token.setCatalog(catalog);
-
+
Domain domain = token.getDomain();
Assert.assertNotNull(domain);
token.setDomain(domain);
-
+
List<Role> roles = token.getRoles();
Assert.assertNotNull(roles);
Assert.assertEquals(2, roles.size());
token.setRoles(roles);
-
+
Project project = token.getProject();
Assert.assertNotNull(project);
token.setProject(project);
-
+
Calendar issuedAt = token.getIssuedAt();
Assert.assertNotNull(issuedAt);
token.setIssuedAt(issuedAt);
-
+
String id = token.getId();
Assert.assertNotNull(id);
token.setId(id);
-
+
User user = token.getUser();
Assert.assertNotNull(user);
token.setUser(user);
-
+
Calendar expiresAt = token.getExpiresAt();
Assert.assertNotNull(expiresAt);
token.setExpiresAt(expiresAt);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UserTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UserTest.java
index dc144ed..c751b7d 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UserTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UserTest.java
@@ -24,7 +24,6 @@ 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 org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -34,26 +33,16 @@ public class UserTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"user\" : {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"password\" : \"password\"," + EOL
- + " \"email\" : \"email\"," + EOL
- + " \"description\" : \"description\"," + EOL
- + " \"enabled\" : false," + EOL
- + " \"domain_id\" : \"domainid\"," + EOL
- + " \"default_project_id\" : \"defaultprojectid\"" + EOL
- + " }" + EOL
- + "}";
-
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(SerializationFeature.WRAP_ROOT_VALUE)
- .enable(DeserializationFeature.UNWRAP_ROOT_VALUE)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private static final String JSON_FULL = "{" + EOL + " \"user\" : {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"name\" : \"name\"," + EOL + " \"password\" : \"password\"," + EOL + " \"email\" : \"email\","
+ + EOL + " \"description\" : \"description\"," + EOL + " \"enabled\" : false," + EOL
+ + " \"domain_id\" : \"domainid\"," + EOL + " \"default_project_id\" : \"defaultprojectid\"" + EOL
+ + " }" + EOL + "}";
+
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(SerializationFeature.WRAP_ROOT_VALUE)
+ .enable(DeserializationFeature.UNWRAP_ROOT_VALUE).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -69,35 +58,35 @@ public class UserTest {
public void testMethods() throws Exception {
User user = objectMapper.readValue(JSON_FULL, User.class);
user.toString();
-
+
String password = user.getPassword();
Assert.assertNotNull(password);
user.setPassword(password);
-
+
String name = user.getName();
Assert.assertNotNull(name);
user.setName(name);
-
+
String description = user.getDescription();
Assert.assertNotNull(description);
user.setDescription(description);
-
+
String id = user.getId();
Assert.assertNotNull(id);
user.setId(id);
-
+
String email = user.getEmail();
Assert.assertNotNull(email);
user.setEmail(email);
-
+
String domainId = user.getDomainId();
Assert.assertNotNull(domainId);
user.setDomainId(domainId);
-
+
Boolean enabled = user.getEnabled();
Assert.assertNotNull(enabled);
user.setEnabled(enabled);
-
+
String defaultProjectId = user.getDefaultProjectId();
Assert.assertNotNull(defaultProjectId);
user.setDefaultProjectId(defaultProjectId);
diff --git a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UsersTest.java b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UsersTest.java
index ab6c557..ceb7df1 100644
--- a/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UsersTest.java
+++ b/keystone-model/src/test/java/com/woorea/openstack/keystone/v3/model/UsersTest.java
@@ -25,9 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.woorea.openstack.keystone.model.User;
-
import java.util.List;
-
import org.junit.Assert;
import org.junit.Test;
import org.skyscreamer.jsonassert.JSONAssert;
@@ -37,31 +35,17 @@ public class UsersTest {
private static final String EOL = System.lineSeparator();
- private static final String JSON_FULL = "{" + EOL
- + " \"users\" : [ {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"username\" : \"username\"," + EOL
- + " \"password\" : \"password\"," + EOL
- + " \"tenantId\" : \"tenantid\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"email\" : \"email\"," + EOL
- + " \"enabled\" : false" + EOL
- + " }, {" + EOL
- + " \"id\" : \"id\"," + EOL
- + " \"username\" : \"username\"," + EOL
- + " \"password\" : \"password\"," + EOL
- + " \"tenantId\" : \"tenantid\"," + EOL
- + " \"name\" : \"name\"," + EOL
- + " \"email\" : \"email\"," + EOL
- + " \"enabled\" : false" + EOL
- + " } ]" + EOL
- + "}";
+ private static final String JSON_FULL = "{" + EOL + " \"users\" : [ {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"username\" : \"username\"," + EOL + " \"password\" : \"password\"," + EOL
+ + " \"tenantId\" : \"tenantid\"," + EOL + " \"name\" : \"name\"," + EOL + " \"email\" : \"email\","
+ + EOL + " \"enabled\" : false" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL
+ + " \"username\" : \"username\"," + EOL + " \"password\" : \"password\"," + EOL
+ + " \"tenantId\" : \"tenantid\"," + EOL + " \"name\" : \"name\"," + EOL + " \"email\" : \"email\","
+ + EOL + " \"enabled\" : false" + EOL + " } ]" + EOL + "}";
- private ObjectMapper objectMapper = new ObjectMapper()
- .setSerializationInclusion(Include.NON_NULL)
- .enable(SerializationFeature.INDENT_OUTPUT)
- .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+ private ObjectMapper objectMapper = new ObjectMapper().setSerializationInclusion(Include.NON_NULL)
+ .enable(SerializationFeature.INDENT_OUTPUT).enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
@Test
public void testSerialization() throws Exception {
@@ -77,13 +61,14 @@ public class UsersTest {
public void testMethods() throws Exception {
Users users = objectMapper.readValue(JSON_FULL, Users.class);
users.toString();
-
+
List<User> list = users.getList();
Assert.assertNotNull(list);
Assert.assertEquals(2, list.size());
-
+
int cnt = 0;
- for (@SuppressWarnings("unused") User x : users) {
+ for (@SuppressWarnings("unused")
+ User x : users) {
++cnt;
}
Assert.assertEquals(2, cnt);