* 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.yangtools.yang.data.api.schema.tree;
+package org.opendaylight.yangtools.yang.data.tree.spi;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import com.google.common.collect.ImmutableList;
import java.util.Collection;
-import java.util.Collections;
+import java.util.List;
import java.util.Optional;
import org.junit.Test;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
+import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModificationCursor;
+import org.opendaylight.yangtools.yang.data.tree.api.ModificationType;
public class DataTreeCandidateNodesTest {
@Test
doReturn(ModificationType.SUBTREE_MODIFIED).when(mockedChildNode3).getModificationType();
final DataTreeCandidateNode mockedChildNode3ChildNode = mock(DataTreeCandidateNode.class);
doReturn(ModificationType.DELETE).when(mockedChildNode3ChildNode).getModificationType();
- doReturn(Collections.singletonList(mockedChildNode3ChildNode)).when(mockedChildNode3).getChildNodes();
+ doReturn(List.of(mockedChildNode3ChildNode)).when(mockedChildNode3).getChildNodes();
- final Collection<DataTreeCandidateNode> childNodes = ImmutableList.of(mockedChildNode1, mockedChildNode2,
+ final Collection<DataTreeCandidateNode> childNodes = List.of(mockedChildNode1, mockedChildNode2,
mockedChildNode3);
doReturn(childNodes).when(mockedDataTreeCandidateNode).getChildNodes();
final DataTreeCandidateNode mockedChildNode1 = mock(DataTreeCandidateNode.class);
doReturn(ModificationType.DELETE).when(mockedChildNode1).getModificationType();
- doReturn(Collections.singletonList(mockedChildNode1)).when(mockedDataTreeCandidateNode).getChildNodes();
+ doReturn(List.of(mockedChildNode1)).when(mockedDataTreeCandidateNode).getChildNodes();
DataTreeCandidateNodes.applyRootedNodeToCursor(mockedCursor, mockedRootPath, mockedDataTreeCandidateNode);
verify(mockedCursor, times(1)).enter((PathArgument) isNull());
final DataTreeCandidateNode mockedChildNode1 = mock(DataTreeCandidateNode.class);
doReturn(ModificationType.DELETE).when(mockedChildNode1).getModificationType();
- doReturn(Collections.singletonList(mockedChildNode1)).when(mockedDataTreeCandidateNode).getChildNodes();
+ doReturn(List.of(mockedChildNode1)).when(mockedDataTreeCandidateNode).getChildNodes();
DataTreeCandidateNodes.applyRootToCursor(mockedCursor, mockedDataTreeCandidateNode);
verify(mockedCursor, times(1)).delete(isNull());