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%2Fxml%2Ftest%2FCnSnToXmlNotExistingLeafTypeTest.java;h=d779b5ce7b5b71e8c56fef7afe6fc45f62e1d844;hb=34c82598f1a898798e5b6dfcad5186889d58dc6c;hp=a2fc138b519e0e53af179074c27f84e37ad33e86;hpb=6eb461f54fe6705b07f34b6cee197ea968de4991;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/xml/test/CnSnToXmlNotExistingLeafTypeTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/xml/test/CnSnToXmlNotExistingLeafTypeTest.java index a2fc138b51..d779b5ce7b 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/xml/test/CnSnToXmlNotExistingLeafTypeTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/xml/test/CnSnToXmlNotExistingLeafTypeTest.java @@ -31,15 +31,16 @@ public class CnSnToXmlNotExistingLeafTypeTest { @Test public void incorrectTopLevelElementTest() { - String xmlOutput = null; + boolean nullPointerExceptionRaised = false; try { - xmlOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(), + TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(), (Set) Collections.EMPTY_SET, prepareDataSchemaNode(), StructuredDataToXmlProvider.INSTANCE); } catch (WebApplicationException | IOException e) { LOG.error("WebApplicationException or IOException was raised"); + } catch (NullPointerException e) { + nullPointerExceptionRaised = true; } - assertNotNull(xmlOutput); - assertTrue(xmlOutput.contains("any value")); + assertTrue(nullPointerExceptionRaised); }