From dd1a401f81b7c90c340ab69288236763bad19e83 Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Sun, 12 Nov 2017 11:14:38 +0200 Subject: sanity fix after merge of BE code Change-Id: I9c994bdbee0ccefb47f065c5a4c6b22bf0e5ccb0 Issue-Id: SDC-608 Signed-off-by: Yuli Shlosberg (cherry picked from commit fe1d9a3def9cd5355682cd22ccfb3a3eb502093c) --- .../org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java | 2 ++ .../org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'test-apis-ci/src/main/java/org/openecomp') diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java index 71735d5a4a..0e0a974885 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ConsumerRestUtils.java @@ -24,6 +24,7 @@ import static org.testng.AssertJUnit.assertEquals; import java.util.Map; +import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectMapper; import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition; import org.openecomp.sdc.be.model.User; @@ -123,6 +124,7 @@ public class ConsumerRestUtils extends BaseRestUtils { String bodyToParse = restResponse.getResponse(); ObjectMapper mapper = new ObjectMapper(); try { + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); ConsumerDataDefinition component = mapper.readValue(bodyToParse, ConsumerDataDefinition.class); return component; } catch (Exception e) { diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java index 95953838c9..7789231c22 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResponseParser.java @@ -215,6 +215,7 @@ public class ResponseParser { mapper.registerModule(module); ComponentInstanceProperty propertyDefinition = null; try { + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); propertyDefinition = mapper.readValue(response, ComponentInstanceProperty.class); logger.debug(propertyDefinition.toString()); } catch (IOException e) { @@ -233,7 +234,7 @@ public class ResponseParser { ObjectMapper mapper = new ObjectMapper(); ArtifactDefinition artifactDefinition = null; try { - + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); artifactDefinition = mapper.readValue(response, ArtifactDefinition.class); logger.debug(artifactDefinition.toString()); } catch (IOException e) { @@ -273,6 +274,7 @@ public class ResponseParser { JsonDeserializer desrializer = new PropertyConstraintJacksonDeserialiser(); addDeserializer(module, PropertyConstraint.class, desrializer); mapper.registerModule(module); + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); try { object = mapper.readValue(json, clazz); // System.out.println("Class: "+clazz.getSimpleName()+", json: @@ -311,6 +313,8 @@ public class ResponseParser { mapper.registerModule(module); Service service = null; try { +// TODO Andrey L. uncomment line below in case to ignore on unknown properties, not recommended, added by Matvey + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); service = mapper.readValue(response, Service.class); logger.debug(service.toString()); } catch (IOException e) { @@ -334,6 +338,7 @@ public class ResponseParser { Product product = null; try { + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); product = mapper.readValue(response, Product.class); logger.debug(product.toString()); } catch (IOException e) { @@ -355,6 +360,7 @@ public class ResponseParser { mapper.registerModule(module); ComponentInstance componentInstance = null; try { + mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); componentInstance = mapper.readValue(response, ComponentInstance.class); logger.debug(componentInstance.toString()); } catch (IOException e) { -- cgit 1.2.3-korg