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.util;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12 import static org.mockito.Mockito.doReturn;
13 import static org.mockito.Mockito.mock;
15 import org.junit.Before;
16 import org.junit.BeforeClass;
17 import org.junit.Test;
18 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.TopicNotification;
19 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
20 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
22 @Deprecated(forRemoval = true)
23 public class TopicDOMNotificationTest {
25 private static final String CONTAINER_NODE_BODY_MOCK_TO_STRING = "containerNodeBodyMock";
26 ContainerNode containerNodeBodyMock;
27 TopicDOMNotification topicDOMNotification;
30 public static void initTestClass() {
35 containerNodeBodyMock = mock(ContainerNode.class);
36 doReturn(CONTAINER_NODE_BODY_MOCK_TO_STRING).when(containerNodeBodyMock).toString();
37 topicDOMNotification = new TopicDOMNotification(containerNodeBodyMock);
41 public void constructorTest() {
42 assertNotNull("Instance has not been created correctly.", topicDOMNotification);
46 public void getTypeTest() {
47 assertEquals("Type has not been created correctly.", Absolute.of(TopicNotification.QNAME),
48 topicDOMNotification.getType());
52 public void getBodyTest() {
53 assertEquals("String has not been created correctly.", containerNodeBodyMock, topicDOMNotification.getBody());
57 public void getToStringTest() {
58 String bodyString = "TopicDOMNotification [body=" + CONTAINER_NODE_BODY_MOCK_TO_STRING + "]";
59 assertEquals("String has not been created correctly.", bodyString, topicDOMNotification.toString());