2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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.parser.spi.validation;
10 import static org.junit.Assert.assertSame;
11 import static org.mockito.Mockito.doReturn;
12 import static org.mockito.Mockito.mock;
13 import static org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.BEHAVIOUR;
14 import static org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType.SUPPORTED_DATA_NODES;
16 import java.util.Collection;
17 import org.junit.Test;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.NamespaceStorageNode;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.StorageNodeType;
21 public class ValidationBundlesNamespaceTest {
23 public void testBehaviour() {
24 final NamespaceStorageNode node = mock(NamespaceStorageNode.class);
25 doReturn(StorageNodeType.GLOBAL).when(node).getStorageNodeType();
27 final Collection<?> result = mock(Collection.class);
28 doReturn(result).when(node).getFromLocalStorage(ValidationBundlesNamespace.class, SUPPORTED_DATA_NODES);
29 assertSame(result, BEHAVIOUR.getFrom(node, SUPPORTED_DATA_NODES));