Eliminate use of deprecated mockito methods
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / databroker / actors / dds / DistributedDataStoreClientBehaviorTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.databroker.actors.dds;
9
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.when;
13
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;
18
19 public class DistributedDataStoreClientBehaviorTest extends AbstractDataStoreClientBehaviorTest {
20     @Override
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);
29     }
30 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.