X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FSimpleShardDataTreeCohortTest.java;h=94617ed4c682d65e444950b8d918b66eea1e81f2;hb=04f22714755ee8e52a63386cc1f4290402659838;hp=34d36b058bbea8f35c5f5370df2ee8098e85918c;hpb=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java index 34d36b058b..94617ed4c6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/SimpleShardDataTreeCohortTest.java @@ -8,7 +8,7 @@ package org.opendaylight.controller.cluster.datastore; import static org.junit.Assert.assertSame; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -70,7 +70,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { private void canCommitSuccess() { doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).successfulCanCommit(); + invocation.getArgument(0).successfulCanCommit(); return null; }).when(mockShardDataTree).startCanCommit(cohort); @@ -84,7 +84,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { private void testValidatationPropagates(final Exception cause) { doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).failedCanCommit(cause); + invocation.getArgument(0).failedCanCommit(cause); return null; }).when(mockShardDataTree).startCanCommit(cohort); @@ -98,12 +98,12 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { @Test public void testCanCommitWithConflictingModEx() { - testValidatationPropagates(new ConflictingModificationAppliedException(YangInstanceIdentifier.EMPTY, "mock")); + testValidatationPropagates(new ConflictingModificationAppliedException(YangInstanceIdentifier.empty(), "mock")); } @Test public void testCanCommitWithDataValidationEx() { - testValidatationPropagates(new DataValidationFailedException(YangInstanceIdentifier.EMPTY, "mock")); + testValidatationPropagates(new DataValidationFailedException(YangInstanceIdentifier.empty(), "mock")); } @Test @@ -114,7 +114,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { private DataTreeCandidateTip preCommitSuccess() { final DataTreeCandidateTip mockCandidate = mock(DataTreeCandidateTip.class); doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).successfulPreCommit(mockCandidate); + invocation.getArgument(0).successfulPreCommit(mockCandidate); return null; }).when(mockShardDataTree).startPreCommit(cohort); @@ -136,8 +136,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { final DataTreeCandidateTip candidate = preCommitSuccess(); doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).successfulCommit(UnsignedLong.valueOf(0), - () -> { }); + invocation.getArgument(0).successfulCommit(UnsignedLong.valueOf(0), () -> { }); return null; }).when(mockShardDataTree).startCommit(cohort, candidate); @@ -157,7 +156,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { final Exception cause = new IllegalArgumentException("mock"); doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).failedPreCommit(cause); + invocation.getArgument(0).failedPreCommit(cause); return null; }).when(mockShardDataTree).startPreCommit(cohort); @@ -195,7 +194,7 @@ public class SimpleShardDataTreeCohortTest extends AbstractTest { final Exception cause = new IllegalArgumentException("mock"); doAnswer(invocation -> { - invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).failedCommit(cause); + invocation.getArgument(0).failedCommit(cause); return null; }).when(mockShardDataTree).startCommit(cohort, candidate);