Bug 8153: Enforce check-style rules for netconf - netconf-util
[netconf.git] / netconf / netconf-util / src / test / java / org / opendaylight / netconf / util / xml / HardcodedNamespaceResolverTest.java
index dd646df7141764f9bfc8d85d8ed23b79cd02a01a..c728862068048bfd09b3854132ad3d9874217764 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.netconf.util.xml;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import org.junit.Test;
@@ -18,13 +19,16 @@ public class HardcodedNamespaceResolverTest {
 
     @Test
     public void testResolver() throws Exception {
-        final HardcodedNamespaceResolver hardcodedNamespaceResolver = new HardcodedNamespaceResolver("prefix", "namespace");
+        final HardcodedNamespaceResolver hardcodedNamespaceResolver =
+                new HardcodedNamespaceResolver("prefix", "namespace");
 
         assertEquals("namespace", hardcodedNamespaceResolver.getNamespaceURI("prefix"));
-        try{
+        try {
             hardcodedNamespaceResolver.getNamespaceURI("unknown");
             fail("Unknown namespace lookup should fail");
-        } catch(IllegalStateException e) {}
+        } catch (IllegalStateException e) {
+            assertTrue(e.getMessage().startsWith("Prefix mapping not found for "));
+        }
 
         assertNull(hardcodedNamespaceResolver.getPrefix("any"));
         assertNull(hardcodedNamespaceResolver.getPrefixes("any"));