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 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;
15 import org.junit.Before;
16 import org.junit.BeforeClass;
17 import org.junit.Test;
18 import org.opendaylight.controller.messagebus.spi.EventSource;
20 public class EventSourceRegistrationImplTest {
22 EventSourceRegistrationImplLocal eventSourceRegistrationImplLocal;
23 EventSourceTopology eventSourceTopologyMock;
26 public static void initTestClass() {
31 EventSource eventSourceMock = mock(EventSource.class);
32 eventSourceTopologyMock = mock(EventSourceTopology.class);
33 eventSourceRegistrationImplLocal = new EventSourceRegistrationImplLocal(eventSourceMock,
34 eventSourceTopologyMock);
38 public void removeRegistrationTest() {
39 eventSourceRegistrationImplLocal.removeRegistration();
40 verify(eventSourceTopologyMock, times(1)).unRegister(any(EventSource.class));
44 private class EventSourceRegistrationImplLocal extends EventSourceRegistrationImpl<EventSource> {
45 EventSourceRegistrationImplLocal(EventSource instance, EventSourceTopology eventSourceTopology) {
46 super(instance, eventSourceTopology);