Merge "BUG 1179 - rpcResult = false but response 200"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / shardstrategy / ShardStrategyFactoryTest.java
1 package org.opendaylight.controller.cluster.datastore.shardstrategy;
2
3 import org.junit.Rule;
4 import org.junit.Test;
5 import org.junit.rules.ExpectedException;
6 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
7
8 import static junit.framework.Assert.assertNotNull;
9
10 public class ShardStrategyFactoryTest {
11
12   @Rule
13   public ExpectedException expectedEx = ExpectedException.none();
14
15   @Test
16   public void testGetStrategy(){
17     ShardStrategy strategy = ShardStrategyFactory.getStrategy(TestModel.TEST_PATH);
18     assertNotNull(strategy);
19   }
20
21   @Test
22   public void testGetStrategyNullPointerExceptionWhenPathIsNull(){
23     expectedEx.expect(NullPointerException.class);
24     expectedEx.expectMessage("path should not be null");
25
26     ShardStrategyFactory.getStrategy(null);
27   }
28
29 }