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.Matchers.any;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.when;
14 import org.opendaylight.controller.cluster.access.client.ClientActorContext;
15 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy;
16 import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory;
17 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
19 public class DistributedDataStoreClientBehaviorTest extends AbstractDataStoreClientBehaviorTest {
21 protected AbstractDataStoreClientBehavior createBehavior(final ClientActorContext clientContext,
22 final ActorContext context) {
23 final ShardStrategyFactory factory = mock(ShardStrategyFactory.class);
24 final ShardStrategy strategy = mock(ShardStrategy.class);
25 when(strategy.findShard(any())).thenReturn(SHARD);
26 when(factory.getStrategy(any())).thenReturn(strategy);
27 when(context.getShardStrategyFactory()).thenReturn(factory);
28 return new DistributedDataStoreClientBehavior(clientContext, context);