Encapsulate regexes in a non-capturing group
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / codecs / StringPatternCheckingCodecTest.java
index 19e53794c80a7538deb671047b650bad41d5cdc4..ce836b9e6f41f67f1f3799ef0d19eb6abf342ab7 100644 (file)
@@ -65,8 +65,8 @@ public class StringPatternCheckingCodecTest {
             codec.deserialize("abcd");
             fail("Exception should have been thrown.");
         } catch (final IllegalArgumentException ex) {
-            LOG.debug("IllegalArgumentException was thrown as expected: {}", ex);
-            assertTrue(ex.getMessage().contains("Supplied value does not match the regular expression ^[A-Z]+$. [abcd]"));
+            LOG.debug("IllegalArgumentException was thrown as expected", ex);
+            assertEquals("Supplied value does not match the regular expression ^(?:[A-Z]+)$. [abcd]", ex.getMessage());
         }
     }
 }