Remove DOMDataTreeProducer-related classes
[controller.git] / opendaylight / md-sal / messagebus-util / src / test / java / org / opendaylight / controller / messagebus / app / util / TopicDOMNotificationTest.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.messagebus.app.util;
9
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;
14
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;
21
22 @Deprecated(forRemoval = true)
23 public class TopicDOMNotificationTest {
24
25     private static final String CONTAINER_NODE_BODY_MOCK_TO_STRING = "containerNodeBodyMock";
26     ContainerNode containerNodeBodyMock;
27     TopicDOMNotification topicDOMNotification;
28
29     @BeforeClass
30     public static void initTestClass() {
31     }
32
33     @Before
34     public void setUp() {
35         containerNodeBodyMock = mock(ContainerNode.class);
36         doReturn(CONTAINER_NODE_BODY_MOCK_TO_STRING).when(containerNodeBodyMock).toString();
37         topicDOMNotification = new TopicDOMNotification(containerNodeBodyMock);
38     }
39
40     @Test
41     public void constructorTest() {
42         assertNotNull("Instance has not been created correctly.", topicDOMNotification);
43     }
44
45     @Test
46     public void getTypeTest() {
47         assertEquals("Type has not been created correctly.", Absolute.of(TopicNotification.QNAME),
48             topicDOMNotification.getType());
49     }
50
51     @Test
52     public void getBodyTest() {
53         assertEquals("String has not been created correctly.", containerNodeBodyMock, topicDOMNotification.getBody());
54     }
55
56     @Test
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());
60     }
61 }