2 * Copyright (c) 2016 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.mdsal.dom.spi;
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
14 import java.util.Collections;
15 import org.junit.Test;
16 import org.junit.runner.RunWith;
17 import org.mockito.Mock;
18 import org.mockito.junit.MockitoJUnitRunner;
19 import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
20 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
22 @RunWith(MockitoJUnitRunner.StrictStubs.class)
23 public class ForwardingDOMNotificationServiceTest extends ForwardingDOMNotificationService {
24 @Mock(name = "domNotificationService")
25 public DOMNotificationService domNotificationService;
28 public void basicTest() throws Exception {
29 final DOMNotificationListener domNotificationListener = mock(DOMNotificationListener.class);
31 doReturn(null).when(domNotificationService).registerNotificationListener(domNotificationListener);
32 this.registerNotificationListener(domNotificationListener);
33 verify(domNotificationService).registerNotificationListener(domNotificationListener);
35 doReturn(null).when(domNotificationService).registerNotificationListener(domNotificationListener,
36 Collections.emptySet());
37 this.registerNotificationListener(domNotificationListener, Collections.emptySet());
38 verify(domNotificationService).registerNotificationListener(domNotificationListener, Collections.emptySet());
42 protected DOMNotificationService delegate() {
43 return domNotificationService;