X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Fcnsn%2Fto%2Fjson%2Ftest%2FCnSnToJsonNotExistingLeafTypeTest.java;h=3ca29c8d65cd485002ef8b46ad7b675d4a4bc581;hb=c222e37f2a0f0f3f6266242fbea2d3b018f4e6e3;hp=24dba17c90cdff4e9a87d0a059160357dcbaad88;hpb=ad98fe1715f343cb93169a9bf7c68a5625da3c7b;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonNotExistingLeafTypeTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonNotExistingLeafTypeTest.java index 24dba17c90..3ca29c8d65 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonNotExistingLeafTypeTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonNotExistingLeafTypeTest.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.sal.restconf.impl.cnsn.to.json.test; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.opendaylight.controller.sal.restconf.impl.test.TestUtils.containsStringData; import java.io.IOException; import java.util.Collections; @@ -45,12 +46,12 @@ public class CnSnToJsonNotExistingLeafTypeTest extends YangAndXmlAndDataSchemaLo @Test public void incorrectTopLevelElementTest() throws WebApplicationException, IOException { String jsonOutput = null; - jsonOutput = TestUtils - .writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(), - Collections.emptySet(), prepareDataSchemaNode(), - StructuredDataToJsonProvider.INSTANCE); + jsonOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(), + Collections. emptySet(), prepareDataSchemaNode(), StructuredDataToJsonProvider.INSTANCE); assertNotNull(jsonOutput); - assertTrue(jsonOutput.contains("\"lf1\": \"\"")); + + // pattern for e.g. > "lf1" : "" < or >"lf1":""< + assertTrue(containsStringData(jsonOutput, "\"lf1\"", ":", "\"\"")); } private CompositeNode prepareCompositeNode() {