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%2FDistributedDataStoreWithSegmentedJournalIntegrationTest.java;h=1e7da9c587e8630224a14b81db75bf4d3cfbd593;hp=b5b3f92f59a8a82003605b0417f44cc1faecd170;hb=HEAD;hpb=abaef4a5ae37f27542155457fe7306a4662b1eeb diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreWithSegmentedJournalIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreWithSegmentedJournalIntegrationTest.java index b5b3f92f59..b5fcc951aa 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreWithSegmentedJournalIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreWithSegmentedJournalIntegrationTest.java @@ -55,7 +55,7 @@ public class DistributedDataStoreWithSegmentedJournalIntegrationTest @Parameters(name = "{0}") public static Collection data() { return Arrays.asList(new Object[][] { - { TestDistributedDataStore.class }, { TestClientBackedDataStore.class } + { TestClientBackedDataStore.class } }); } @@ -96,8 +96,8 @@ public class DistributedDataStoreWithSegmentedJournalIntegrationTest final IntegrationTestKit testKit = new IntegrationTestKit(getSystem(), datastoreContextBuilder); CollectionNodeBuilder carMapBuilder = ImmutableNodes.mapNodeBuilder(CAR_QNAME); - try (AbstractDataStore dataStore = testKit.setupAbstractDataStore( - testParameter, "testManyWritesDeletes", "module-shards-cars-member-1.conf", true, "cars")) { + try (var dataStore = testKit.setupDataStore(testParameter, "testManyWritesDeletes", + "module-shards-cars-member-1.conf", true, "cars")) { DOMStoreTransactionChain txChain = dataStore.createTransactionChain(); @@ -133,7 +133,7 @@ public class DistributedDataStoreWithSegmentedJournalIntegrationTest MapNode cars = carMapBuilder.build(); - assertEquals("cars not matching result", cars, optional.get()); + assertEquals("cars not matching result", cars, optional.orElseThrow()); txChain.close(); @@ -155,16 +155,15 @@ public class DistributedDataStoreWithSegmentedJournalIntegrationTest } // test restoration from journal and verify data matches - try (AbstractDataStore dataStore = testKit.setupAbstractDataStore( - testParameter, "testManyWritesDeletes", "module-shards-cars-member-1.conf", true, "cars")) { + try (var dataStore = testKit.setupDataStore(testParameter, "testManyWritesDeletes", + "module-shards-cars-member-1.conf", true, "cars")) { DOMStoreTransactionChain txChain = dataStore.createTransactionChain(); MapNode cars = carMapBuilder.build(); final Optional optional = txChain.newReadOnlyTransaction() .read(CarsModel.CAR_LIST_PATH).get(5, TimeUnit.SECONDS); - assertTrue("isPresent", optional.isPresent()); - assertEquals("restored cars do not match snapshot", cars, optional.get()); + assertEquals("restored cars do not match snapshot", Optional.of(cars), optional); txChain.close(); }