Remove unused exceptions
[controller.git] / opendaylight / md-sal / messagebus-impl / src / test / java / org / opendaylight / controller / messagebus / app / impl / EventSourceRegistrationImplTest.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.messagebus.app.impl;
9
10 import static org.mockito.Matchers.any;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.times;
13 import static org.mockito.Mockito.verify;
14
15 import org.junit.Before;
16 import org.junit.BeforeClass;
17 import org.junit.Test;
18 import org.opendaylight.controller.messagebus.spi.EventSource;
19
20 public class EventSourceRegistrationImplTest {
21
22     EventSourceRegistrationImplLocal eventSourceRegistrationImplLocal;
23     EventSourceTopology eventSourceTopologyMock;
24
25     @BeforeClass
26     public static void initTestClass() {
27     }
28
29     @Before
30     public void setUp() {
31         EventSource eventSourceMock = mock(EventSource.class);
32         eventSourceTopologyMock = mock(EventSourceTopology.class);
33         eventSourceRegistrationImplLocal = new EventSourceRegistrationImplLocal(eventSourceMock,
34                 eventSourceTopologyMock);
35     }
36
37     @Test
38     public void removeRegistrationTest() {
39         eventSourceRegistrationImplLocal.removeRegistration();
40         verify(eventSourceTopologyMock, times(1)).unRegister(any(EventSource.class));
41     }
42
43
44     private class EventSourceRegistrationImplLocal extends EventSourceRegistrationImpl<EventSource> {
45         EventSourceRegistrationImplLocal(EventSource instance, EventSourceTopology eventSourceTopology) {
46             super(instance, eventSourceTopology);
47         }
48     }
49
50 }