From 79dc74fd69086cf9937ed06241fed9a2772b0fba Mon Sep 17 00:00:00 2001 From: sourabh_sourabh Date: Wed, 29 Jun 2022 12:36:40 +0100 Subject: Composite state transition code change - Code cannge to set datastore to Unsynchronized when state moves from advice to ready - if resource data is not available or there is any issue while reading data from simulator then state will be set to synchronized else remain unsynchronized. - Handle serialization failure on empty bean. Issue-ID: CPS-1000 Signed-off-by: sourabh_sourabh Change-Id: Ie51a787770da649e00aaefc00341756f92f9fa83 --- .../src/test/groovy/org/onap/cps/utils/JsonObjectMapperSpec.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cps-service') diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/JsonObjectMapperSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/JsonObjectMapperSpec.groovy index acb52413f..461014418 100644 --- a/cps-service/src/test/groovy/org/onap/cps/utils/JsonObjectMapperSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/utils/JsonObjectMapperSpec.groovy @@ -22,6 +22,7 @@ package org.onap.cps.utils import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature import groovy.json.JsonSlurper import org.onap.cps.TestUtils import org.onap.cps.spi.exceptions.DataValidationException @@ -79,10 +80,12 @@ class JsonObjectMapperSpec extends Specification { def 'Map a unstructured object to json String.'() { given: 'Unstructured object' def object = new Object() + and: 'disable serialization failure on empty bean' + spiedObjectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); when: 'the object is mapped to string' jsonObjectMapper.asJsonString(object); - then: 'an exception is thrown' - thrown(DataValidationException) + then: 'no exception is thrown' + noExceptionThrown() } def 'Map a structurally compatible json String to JsonNode.'() { -- cgit 1.2.3-korg