2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.api.schema;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.mockito.Mockito.doReturn;
13 import java.util.List;
15 import org.junit.jupiter.api.Test;
16 import org.junit.jupiter.api.extension.ExtendWith;
17 import org.mockito.Mock;
18 import org.mockito.junit.jupiter.MockitoExtension;
20 @ExtendWith(MockitoExtension.class)
21 // FIXME: This is a sorry-ass of a test. Move the method, DuplicateFinder and this test to yang-data-util and expand
22 // coverage using ImmutableNodes.
25 private LeafNode<?> leaf;
27 private ContainerNode container;
30 public void testDuplicateLeaf() {
31 assertEquals(Map.of(), NormalizedNodes.findDuplicates(leaf));
35 public void testDuplicateContainer() {
36 doReturn(List.of()).when(container).body();
37 assertEquals(Map.of(), NormalizedNodes.findDuplicates(container));