Bump to odlparent 3.1.0 and yangtools 2.0.3
[packetcable.git] / packetcable-policy-server / src / test / java / org / opendaylight / controller / packetcable / provider / PacketcableProviderTest.java
1 package org.opendaylight.controller.packetcable.provider;
2
3 import static org.junit.Assert.assertNotNull;
4 import static org.mockito.Matchers.any;
5 import static org.mockito.Mockito.times;
6 import static org.mockito.Mockito.verify;
7 import static org.mockito.Mockito.when;
8
9 import java.net.InetAddress;
10 import java.util.concurrent.ExecutionException;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.junit.runner.RunWith;
14 import org.mockito.Mock;
15 import org.mockito.runners.MockitoJUnitRunner;
16
17 @RunWith(MockitoJUnitRunner.class)
18 public class PacketcableProviderTest {
19
20     @Mock InetAddress inetAddress;
21     @Mock PacketcableProvider packetCableProv;
22
23     @Before
24     public void setUp() throws Exception {
25         when(packetCableProv.getInetAddress(any(String.class))).thenReturn(inetAddress);
26     }
27
28     @Test
29     public final void testClose() throws ExecutionException, InterruptedException {
30         packetCableProv.close();
31         verify(packetCableProv, times(1)).close();
32     }
33
34     @Test
35     public final void testGetInetAddress() {
36       assertNotNull(packetCableProv.getInetAddress("127.0.0.1"));
37       verify(packetCableProv).getInetAddress("127.0.0.1");
38     }
39
40 }