X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fidentifiers%2FChainedTransactionIdentifierTest.java;h=64f04add99592c3c6fd24029b6adfa75c6be2646;hp=ba3130b5fd88dca4733834517d00ce19b280cfd3;hb=93e6f3bfc003d4ce2d968761dff963615a0b799d;hpb=86e398bb1e1a60f7516b398a0f27268bf232049d diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java index ba3130b5fd..64f04add99 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java @@ -1,14 +1,24 @@ +/* + * Copyright (c) 2015 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.cluster.datastore.identifiers; -import static org.junit.Assert.assertEquals; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import org.junit.Test; +import org.opendaylight.controller.cluster.access.concepts.MemberName; public class ChainedTransactionIdentifierTest { @Test public void testToString(){ - TransactionChainIdentifier chainId = new TransactionChainIdentifier("member-1", 99); + TransactionChainIdentifier chainId = new TransactionChainIdentifier(MemberName.forName("member-1"), 99); ChainedTransactionIdentifier chainedTransactionIdentifier = new ChainedTransactionIdentifier(chainId, 100); String txnId = chainedTransactionIdentifier.toString(); @@ -17,7 +27,7 @@ public class ChainedTransactionIdentifierTest { assertTrue(txnId.contains("100")); assertTrue(txnId.contains("99")); - assertEquals("member-1-chn-99-txn-100", txnId); + assertThat(txnId, startsWith("member-1-chn-99-txn-100-")); } } \ No newline at end of file