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%2Ftest%2FNormalizeNodeTest.java;h=6d2723c2f17391e8fff4d30e983d236aa5e39c10;hb=c61d22e4dc73fdaba09aa8c0b189ea7459679e03;hp=1573b570287a02f8531381743c996dd6f6061962;hpb=811583cee43dd5a0198acdb179ae9c80160ca65f;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/NormalizeNodeTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/NormalizeNodeTest.java index 1573b57028..6d2723c2f1 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/NormalizeNodeTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/NormalizeNodeTest.java @@ -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