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.mdsal.dom.spi;
10 import static org.junit.Assert.assertNotNull;
11 import static org.junit.Assert.assertSame;
12 import static org.junit.Assert.assertTrue;
13 import static org.mockito.Mockito.mock;
15 import com.google.common.collect.ImmutableClassToInstanceMap;
16 import org.junit.Test;
17 import org.opendaylight.mdsal.dom.api.DOMService;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
20 public class SimpleDOMMountPointTest {
22 public void basicTest() throws Exception {
23 final var domService = mock(DOMService.class);
24 final var classToInstanceMap = ImmutableClassToInstanceMap.of(DOMService.class, domService);
26 final SimpleDOMMountPoint simpleDOMMountPoint =
27 SimpleDOMMountPoint.create(YangInstanceIdentifier.empty(), classToInstanceMap);
28 assertNotNull(simpleDOMMountPoint);
30 assertSame(YangInstanceIdentifier.empty(), simpleDOMMountPoint.getIdentifier());
31 assertTrue(simpleDOMMountPoint.getService(DOMService.class).isPresent());
32 assertSame(domService, simpleDOMMountPoint.getService(DOMService.class).orElseThrow());