diff options
Diffstat (limited to 'heat-model/src/test/java/com')
10 files changed, 99 insertions, 87 deletions
diff --git a/heat-model/src/test/java/com/woorea/openstack/heat/model/CreateStackParamTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/CreateStackParamTest.java index f181175..a57eced 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/CreateStackParamTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/CreateStackParamTest.java @@ -20,12 +20,13 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.CreateStackParam; +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.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -53,9 +54,10 @@ public class CreateStackParamTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/ErrorTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/ErrorTest.java index 76582e7..084fd26 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/ErrorTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/ErrorTest.java @@ -20,11 +20,12 @@ package com.woorea.openstack.heat.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 com.woorea.openstack.heat.model.Explanation.Error; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -43,11 +44,12 @@ public class ErrorTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(SerializationConfig.Feature.WRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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 { diff --git a/heat-model/src/test/java/com/woorea/openstack/heat/model/ExplanationTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/ExplanationTest.java index 4132cb0..ff8ebb2 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/ExplanationTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/ExplanationTest.java @@ -20,12 +20,12 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Explanation; +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 com.woorea.openstack.heat.model.Explanation.Error; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -47,9 +47,10 @@ public class ExplanationTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/LinkTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/LinkTest.java index 503e0e5..4565fe8 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/LinkTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/LinkTest.java @@ -20,11 +20,11 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Link; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; +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; @@ -40,9 +40,10 @@ public class LinkTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/OutputTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/OutputTest.java index cc07012..a91eeff 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/OutputTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/OutputTest.java @@ -20,11 +20,12 @@ package com.woorea.openstack.heat.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 com.woorea.openstack.heat.model.Stack.Output; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -41,9 +42,10 @@ public class OutputTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourceTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourceTest.java index ff7497e..0079ef3 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourceTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourceTest.java @@ -20,14 +20,14 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Link; -import com.woorea.openstack.heat.model.Resource; +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.Date; import java.util.List; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -56,9 +56,10 @@ public class ResourceTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourcesTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourcesTest.java index 0093ab3..37c5e72 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourcesTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/ResourcesTest.java @@ -20,13 +20,13 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Resource; -import com.woorea.openstack.heat.model.Resources; +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.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -73,9 +73,10 @@ public class ResourcesTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/StackTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/StackTest.java index 8659895..ea38918 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/StackTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/StackTest.java @@ -20,16 +20,16 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Link; -import com.woorea.openstack.heat.model.Stack; +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 com.woorea.openstack.heat.model.Stack.Output; + import java.util.Date; import java.util.List; import java.util.Map; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -76,11 +76,12 @@ public class StackTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(SerializationConfig.Feature.WRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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 { diff --git a/heat-model/src/test/java/com/woorea/openstack/heat/model/StacksTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/StacksTest.java index 884d5a9..880c482 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/StacksTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/StacksTest.java @@ -20,13 +20,11 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.Stack; -import com.woorea.openstack.heat.model.Stacks; -import java.util.List; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; +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; @@ -105,9 +103,10 @@ public class StacksTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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/heat-model/src/test/java/com/woorea/openstack/heat/model/UpdateStackParamTest.java b/heat-model/src/test/java/com/woorea/openstack/heat/model/UpdateStackParamTest.java index 5bff417..5eb99c3 100644 --- a/heat-model/src/test/java/com/woorea/openstack/heat/model/UpdateStackParamTest.java +++ b/heat-model/src/test/java/com/woorea/openstack/heat/model/UpdateStackParamTest.java @@ -20,12 +20,13 @@ package com.woorea.openstack.heat.model; -import com.woorea.openstack.heat.model.UpdateStackParam; +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.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -52,9 +53,10 @@ public class UpdateStackParamTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .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 { |