Deprecate messagebus for removal
[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.ArgumentMatchers.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 @Deprecated(forRemoval = true)
21 public class EventSourceRegistrationImplTest {
22
23     EventSourceRegistrationImplLocal eventSourceRegistrationImplLocal;
24     EventSourceTopology eventSourceTopologyMock;
25
26     @BeforeClass
27     public static void initTestClass() {
28     }
29
30     @Before
31     public void setUp() {
32         EventSource eventSourceMock = mock(EventSource.class);
33         eventSourceTopologyMock = mock(EventSourceTopology.class);
34         eventSourceRegistrationImplLocal = new EventSourceRegistrationImplLocal(eventSourceMock,
35                 eventSourceTopologyMock);
36     }
37
38     @Test
39     public void removeRegistrationTest() {
40         eventSourceRegistrationImplLocal.removeRegistration();
41         verify(eventSourceTopologyMock, times(1)).unRegister(any(EventSource.class));
42     }
43
44
45     private class EventSourceRegistrationImplLocal extends EventSourceRegistrationImpl<EventSource> {
46         EventSourceRegistrationImplLocal(final EventSource instance, final EventSourceTopology eventSourceTopology) {
47             super(instance, eventSourceTopology);
48         }
49     }
50
51 }