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.controller.cluster.databroker.actors.dds;
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.mockito.Mockito.doReturn;
12 import static org.mockito.Mockito.mock;
15 import org.opendaylight.controller.cluster.access.client.ClientActorContext;
16 import org.opendaylight.controller.cluster.datastore.config.Configuration;
17 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
18 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
19 import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
21 public class DistributedDataStoreClientBehaviorTest extends AbstractDataStoreClientBehaviorTest {
23 protected AbstractDataStoreClientBehavior createBehavior(final ClientActorContext clientContext,
24 final ActorUtils context) {
25 final ShardStrategy strategy = mock(ShardStrategy.class);
26 doReturn(SHARD).when(strategy).findShard(any());
27 final ShardStrategyFactory factory = mock(ShardStrategyFactory.class);
28 doReturn(strategy).when(factory).getStrategy(any());
29 doReturn(factory).when(context).getShardStrategyFactory();
31 final Configuration config = mock(Configuration.class);
32 doReturn(Set.of(SHARD)).when(config).getAllShardNames();
33 doReturn(config).when(context).getConfiguration();
35 return new DistributedDataStoreClientBehavior(clientContext, context);