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.store.inmemory;
10 import static org.junit.Assert.assertNotNull;
11 import static org.mockito.Matchers.anyCollectionOf;
12 import static org.mockito.Mockito.doReturn;
13 import static org.mockito.Mockito.mock;
14 import static org.mockito.Mockito.verify;
15 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.DOM_DATA_TREE_IDENTIFIER;
16 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.resetMocks;
18 import com.google.common.collect.ImmutableSet;
19 import org.junit.Test;
20 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
22 public class InMemoryDOMDataTreeShardProducerTest {
25 public void basicTest() throws Exception {
26 final InMemoryDOMDataTreeShard inMemoryDOMDataTreeShard = mock(InMemoryDOMDataTreeShard.class);
27 final InmemoryDOMDataTreeShardWriteTransaction inmemoryDOMDataTreeShardWriteTransaction =
28 mock(InmemoryDOMDataTreeShardWriteTransaction.class);
29 doReturn(inmemoryDOMDataTreeShardWriteTransaction).when(inMemoryDOMDataTreeShard)
30 .createTransaction(anyCollectionOf((DOMDataTreeIdentifier.class)));
32 final InMemoryDOMDataTreeShardProducer inMemoryDOMDataTreeShardProducer =
33 new InMemoryDOMDataTreeShardProducer(inMemoryDOMDataTreeShard,
34 ImmutableSet.of(DOM_DATA_TREE_IDENTIFIER));
36 assertNotNull(inMemoryDOMDataTreeShardProducer.createTransaction());
37 verify(inMemoryDOMDataTreeShard).createTransaction(anyCollectionOf(DOMDataTreeIdentifier.class));