private SimpleShardDataTreeCohort cohort;
@Before
- public void setup() throws Exception {
+ public void setup() {
MockitoAnnotations.initMocks(this);
doReturn(Optional.empty()).when(mockUserCohorts).commit();
doReturn(Optional.empty()).when(mockUserCohorts).abort();
cohort = new SimpleShardDataTreeCohort(mockShardDataTree, mockModification, nextTransactionId(),
- mockUserCohorts);
+ mockUserCohorts, Optional.empty());
}
@Test
- public void testCanCommitSuccess() throws Exception {
+ public void testCanCommitSuccess() {
canCommitSuccess();
}
verifyNoMoreInteractions(callback);
}
- private void testValidatationPropagates(final Exception cause) throws DataValidationFailedException {
+ private void testValidatationPropagates(final Exception cause) {
doAnswer(invocation -> {
invocation.getArgumentAt(0, SimpleShardDataTreeCohort.class).failedCanCommit(cause);
return null;
}
@Test
- public void testCanCommitWithConflictingModEx() throws DataValidationFailedException {
+ public void testCanCommitWithConflictingModEx() {
testValidatationPropagates(new ConflictingModificationAppliedException(YangInstanceIdentifier.EMPTY, "mock"));
}
@Test
- public void testCanCommitWithDataValidationEx() throws DataValidationFailedException {
+ public void testCanCommitWithDataValidationEx() {
testValidatationPropagates(new DataValidationFailedException(YangInstanceIdentifier.EMPTY, "mock"));
}
@Test
- public void testCanCommitWithIllegalArgumentEx() throws DataValidationFailedException {
+ public void testCanCommitWithIllegalArgumentEx() {
testValidatationPropagates(new IllegalArgumentException("mock"));
}
}
@Test
- public void testPreCommitAndCommitSuccess() throws Exception {
+ public void testPreCommitAndCommitSuccess() {
canCommitSuccess();
final DataTreeCandidateTip candidate = preCommitSuccess();
}
@Test
- public void testPreCommitWithIllegalArgumentEx() throws Exception {
+ public void testPreCommitWithIllegalArgumentEx() {
canCommitSuccess();
final Exception cause = new IllegalArgumentException("mock");
}
@Test
- public void testPreCommitWithReportedFailure() throws Exception {
+ public void testPreCommitWithReportedFailure() {
canCommitSuccess();
final Exception cause = new IllegalArgumentException("mock");