diff options
Diffstat (limited to 'nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.java')
-rw-r--r-- | nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.java | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.java b/nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.java index f409aa2..441d498 100644 --- a/nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.java +++ b/nova-model/src/test/java/com/woorea/openstack/nova/model/VolumeAttachmentsTest.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 VolumeAttachmentsTest { private static final String EOL = System.lineSeparator(); - private static final String JSON_FULL = "{" + EOL - + " \"volumeAttachments\" : [ {" + EOL - + " \"id\" : \"id\"," + EOL - + " \"volumeId\" : \"volumeid\"," + EOL - + " \"serverId\" : \"serverid\"," + EOL - + " \"device\" : \"device\"" + EOL - + " }, {" + EOL - + " \"id\" : \"id\"," + EOL - + " \"volumeId\" : \"volumeid\"," + EOL - + " \"serverId\" : \"serverid\"," + EOL - + " \"device\" : \"device\"" + EOL - + " } ]" + EOL - + "}"; + private static final String JSON_FULL = "{" + EOL + " \"volumeAttachments\" : [ {" + EOL + " \"id\" : \"id\"," + + EOL + " \"volumeId\" : \"volumeid\"," + EOL + " \"serverId\" : \"serverid\"," + EOL + + " \"device\" : \"device\"" + EOL + " }, {" + EOL + " \"id\" : \"id\"," + EOL + + " \"volumeId\" : \"volumeid\"," + EOL + " \"serverId\" : \"serverid\"," + EOL + + " \"device\" : \"device\"" + 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 VolumeAttachmentsTest { public void testMethods() throws Exception { VolumeAttachments volumeattachments = objectMapper.readValue(JSON_FULL, VolumeAttachments.class); volumeattachments.toString(); - + List<VolumeAttachment> list = volumeattachments.getList(); Assert.assertNotNull(list); Assert.assertEquals(2, list.size()); - + int cnt = 0; - for (@SuppressWarnings("unused") VolumeAttachment x : volumeattachments) { + for (@SuppressWarnings("unused") + VolumeAttachment x : volumeattachments) { ++cnt; } Assert.assertEquals(2, cnt); |