X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2FQNameFactoryTest.java;h=557675edb9cb46bb6a0abdf1db22e96f99a56db2;hp=9f5419d20339dbedacf14e2aae8f17fbffb5b4b5;hb=f746b92d9aa9495a13ce92c01c5c1ae3228bb662;hpb=1a33f8ff73b05cf4d21f0cc989471ec68b14b145;ds=sidebyside diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java index 9f5419d203..557675edb9 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java @@ -12,7 +12,6 @@ import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import org.junit.Test; -import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory.Key; import org.opendaylight.controller.cluster.datastore.util.TestModel; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.Revision; @@ -34,16 +33,16 @@ public class QNameFactoryTest { @Test public void testBasic() { QName expected = TestModel.AUG_NAME_QNAME; - QName created = QNameFactory.create(createKey(expected)); + QName created = lookup(expected); assertNotSame(expected, created); assertEquals(expected, created); - QName cached = QNameFactory.create(createKey(expected)); + QName cached = lookup(expected); assertSame(created, cached); } - private static Key createKey(final QName qname) { - return new Key(qname.getLocalName(), qname.getNamespace().toString(), + private static QName lookup(final QName qname) { + return QNameFactory.create(qname.getLocalName(), qname.getNamespace().toString(), qname.getRevision().map(Revision::toString).orElse(null)); } }