2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.messagebus.app.impl;
10 import org.junit.Before;
11 import org.junit.BeforeClass;
12 import org.junit.Test;
13 import org.opendaylight.controller.messagebus.spi.EventSource;
15 import static org.mockito.Matchers.any;
16 import static org.mockito.Mockito.mock;
17 import static org.mockito.Mockito.times;
18 import static org.mockito.Mockito.verify;
20 public class EventSourceRegistrationImplTest {
22 EventSourceRegistrationImplLocal eventSourceRegistrationImplLocal;
23 EventSourceTopology eventSourceTopologyMock;
26 public static void initTestClass() throws IllegalAccessException, InstantiationException {
30 public void setUp() throws Exception {
31 EventSource eventSourceMock = mock(EventSource.class);
32 eventSourceTopologyMock = mock(EventSourceTopology.class);
33 eventSourceRegistrationImplLocal = new EventSourceRegistrationImplLocal(eventSourceMock, eventSourceTopologyMock);
37 public void removeRegistrationTest() {
38 eventSourceRegistrationImplLocal.removeRegistration();
39 verify(eventSourceTopologyMock, times(1)).unRegister(any(EventSource.class));
43 private class EventSourceRegistrationImplLocal extends EventSourceRegistrationImpl{
46 * @param instance of EventSource that has been registered by {@link EventSourceRegistryImpl#registerEventSource(Node, org.opendaylight.controller.messagebus.spi.EventSource)}
47 * @param eventSourceTopology
49 public EventSourceRegistrationImplLocal(EventSource instance, EventSourceTopology eventSourceTopology) {
50 super(instance, eventSourceTopology);