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;
13 import static org.mockito.MockitoAnnotations.initMocks;
15 import java.util.Collections;
16 import org.junit.Test;
17 import org.mockito.Mock;
18 import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
19 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
21 public class ForwardingDOMNotificationServiceTest extends ForwardingDOMNotificationService {
23 @Mock(name = "domNotificationService")
24 private DOMNotificationService domNotificationService;
27 public void basicTest() throws Exception {
30 final DOMNotificationListener domNotificationListener = mock(DOMNotificationListener.class);
32 doReturn(null).when(domNotificationService).registerNotificationListener(domNotificationListener);
33 this.registerNotificationListener(domNotificationListener);
34 verify(domNotificationService).registerNotificationListener(domNotificationListener);
36 doReturn(null).when(domNotificationService).registerNotificationListener(domNotificationListener,
37 Collections.emptySet());
38 this.registerNotificationListener(domNotificationListener, Collections.emptySet());
39 verify(domNotificationService).registerNotificationListener(domNotificationListener, Collections.emptySet());
43 protected DOMNotificationService delegate() {
44 return domNotificationService;