Fix typo in match types yang model
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / cnsn / to / xml / test / CnSnToXmlNotExistingLeafTypeTest.java
index a2fc138b519e0e53af179074c27f84e37ad33e86..4218a69d3b9821562b3a38bb7a5a87ac85470e0e 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.sal.restconf.impl.cnsn.to.xml.test;
 
 import static org.junit.Assert.assertNotNull;
@@ -31,15 +38,16 @@ public class CnSnToXmlNotExistingLeafTypeTest {
     @Test
     public void incorrectTopLevelElementTest() {
 
-        String xmlOutput = null;
+        boolean nullPointerExceptionRaised = false;
         try {
-            xmlOutput = TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(),
+            TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(),
                     (Set<Module>) 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("<lf1>any value</lf1>"));
+        assertTrue(nullPointerExceptionRaised);
 
     }
 
@@ -62,8 +70,7 @@ public class CnSnToXmlNotExistingLeafTypeTest {
         leafBuild.setConfiguration(true);
 
         contBuild.addChildNode(leafBuild);
-        return contBuild.build(null);
-
+        return contBuild.build();
     }
 
 }