+/*
+ * 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;
@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