Merge changes I805ec065,Idc9995b1
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / NormalizeNodeTest.java
index 1573b570287a02f8531381743c996dd6f6061962..6d2723c2f17391e8fff4d30e983d236aa5e39c10 100644 (file)
@@ -1,8 +1,13 @@
+/*
+ * 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.test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.*;
 
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -23,15 +28,13 @@ public class NormalizeNodeTest extends YangAndXmlAndDataSchemaLoader {
 
     @Test
     public void namespaceNotNullAndInvalidNamespaceAndNoModuleNameTest() {
-        String exceptionMessage = null;
+        boolean exceptionReised = false;
         try {
             TestUtils.normalizeCompositeNode(prepareCnSn("wrongnamespace"), modules, schemaNodePath);
         } catch (ResponseException e) {
-            exceptionMessage = String.valueOf(e.getResponse().getEntity());
+            exceptionReised = true;
         }
-        assertEquals(
-                exceptionMessage,
-                "Data has bad format.\nIf data is in XML format then namespace for cont should be normalize:node:module.\nIf data is in Json format then module name for cont should be normalize-node-module.");
+        assertTrue(exceptionReised);
     }
 
     @Test