X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fimpl%2Fcodecs%2FStringPatternCheckingCodecTest.java;h=5922e6bf1d881b1f92ca447daa6efcbaab5946f0;hb=f4212253d03d6917ce6317d99c4d47a1e5028905;hp=e024f9599b4ae19139a1cbef28af8a2611ae98c4;hpb=0dd8380053ea0ce481290cc14c11ceedc197f1d8;p=yangtools.git diff --git a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codecs/StringPatternCheckingCodecTest.java b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codecs/StringPatternCheckingCodecTest.java index e024f9599b..5922e6bf1d 100644 --- a/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codecs/StringPatternCheckingCodecTest.java +++ b/yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codecs/StringPatternCheckingCodecTest.java @@ -5,7 +5,6 @@ * 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.yangtools.yang.data.impl.codecs; import static org.junit.Assert.assertEquals; @@ -39,13 +38,11 @@ public class StringPatternCheckingCodecTest { final QNameModule testModuleQName = QNameModule.create(URI.create("string-pattern-checking-codec-test")); final Module testModule = schemaContext.findModules("string-pattern-checking-codec-test").iterator().next(); - final ContainerSchemaNode testContainer = (ContainerSchemaNode) testModule.getDataChildByName( - QName.create(testModuleQName, "test-container")); - assertNotNull(testContainer); + final ContainerSchemaNode testContainer = (ContainerSchemaNode) testModule.findDataChildByName( + QName.create(testModuleQName, "test-container")).get(); - final LeafSchemaNode testLeaf = (LeafSchemaNode) testContainer.getDataChildByName( - QName.create(testModuleQName, "string-leaf-with-valid-pattern")); - assertNotNull(testLeaf); + final LeafSchemaNode testLeaf = (LeafSchemaNode) testContainer.findDataChildByName( + QName.create(testModuleQName, "string-leaf-with-valid-pattern")).get(); final StringCodec codec = getCodec(testLeaf.getType(), StringCodec.class); assertNotNull(codec); @@ -56,8 +53,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); - assertEquals("Supplied value does not match the regular expression ^[A-Z]+$.", ex.getMessage()); + LOG.debug("IllegalArgumentException was thrown as expected", ex); + assertEquals("Value 'abcd' does not match regular expression '[A-Z]+'", ex.getMessage()); } } }