X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fmessagebus-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmessagebus%2Fapp%2Fimpl%2FEventSourceTopologyTest.java;fp=opendaylight%2Fmd-sal%2Fmessagebus-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmessagebus%2Fapp%2Fimpl%2FEventSourceTopologyTest.java;h=fda32a6adee1da1ccbd12a820bdc67867159c299;hp=56d67bff4dc8bb690d558ba873b0d00bbf7a9067;hb=f9814cf027886294b74fb6c8748f4a3e0a545e86;hpb=3417dcaad1c2c187413b0c64a0c6ccdd546e794c diff --git a/opendaylight/md-sal/messagebus-impl/src/test/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopologyTest.java b/opendaylight/md-sal/messagebus-impl/src/test/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopologyTest.java index 56d67bff4d..fda32a6ade 100644 --- a/opendaylight/md-sal/messagebus-impl/src/test/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopologyTest.java +++ b/opendaylight/md-sal/messagebus-impl/src/test/java/org/opendaylight/controller/messagebus/app/impl/EventSourceTopologyTest.java @@ -18,7 +18,6 @@ import static org.mockito.Mockito.verify; import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -98,7 +97,7 @@ public class EventSourceTopologyTest { public void destroyTopicTest() throws Exception { topicTestHelper(); TopicId topicId = new TopicId("topic-id-007"); - Map localMap = getEventSourceTopicMap(); + Map localMap = eventSourceTopology.getEventSourceTopicMap(); EventSourceTopic eventSourceTopic = EventSourceTopic.create(new NotificationPattern("foo"), "pattern", eventSourceTopology); localMap.put(topicId, eventSourceTopic); @@ -146,7 +145,7 @@ public class EventSourceTopologyTest { public void closeTest() throws Exception { constructorTestHelper(); topicTestHelper(); - Map localMap = getEventSourceTopicMap(); + Map localMap = eventSourceTopology.getEventSourceTopicMap(); TopicId topicIdMock = mock(TopicId.class); EventSourceTopic eventSourceTopic = EventSourceTopic.create(new NotificationPattern("foo"), "pattern", eventSourceTopology); @@ -163,7 +162,7 @@ public class EventSourceTopologyTest { EventSource eventSourceMock = mock(EventSource.class); NodeId nodeId = new NodeId("nodeIdValue1"); nodeKey = new NodeKey(nodeId); - doReturn(nodeKey).when(nodeMock).getKey(); + doReturn(nodeKey).when(nodeMock).key(); doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey(); BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock( BindingAwareBroker.RoutedRpcRegistration.class); @@ -182,8 +181,8 @@ public class EventSourceTopologyTest { EventSource eventSourceMock = mock(EventSource.class); NodeId nodeId = new NodeId("nodeIdValue1"); nodeKey = new NodeKey(nodeId); - Map> localMap = - getRoutedRpcRegistrations(); + Map> localMap = eventSourceTopology + .getRoutedRpcRegistrations(); NodeKey nodeKeyMock = mock(NodeKey.class); doReturn(nodeKeyMock).when(eventSourceMock).getSourceNodeKey(); BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = @@ -200,7 +199,7 @@ public class EventSourceTopologyTest { EventSource eventSourceMock = mock(EventSource.class); NodeId nodeId = new NodeId("nodeIdValue1"); nodeKey = new NodeKey(nodeId); - doReturn(nodeKey).when(nodeMock).getKey(); + doReturn(nodeKey).when(nodeMock).key(); doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey(); BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock( BindingAwareBroker.RoutedRpcRegistration.class); @@ -211,17 +210,4 @@ public class EventSourceTopologyTest { assertNotNull("Return value has not been created correctly.", eventSourceTopology.registerEventSource(eventSourceMock)); } - - private Map getEventSourceTopicMap() throws Exception { - Field nesField = EventSourceTopology.class.getDeclaredField("eventSourceTopicMap"); - nesField.setAccessible(true); - return (Map) nesField.get(eventSourceTopology); - } - - private Map getRoutedRpcRegistrations() throws Exception { - Field nesField = EventSourceTopology.class.getDeclaredField("routedRpcRegistrations"); - nesField.setAccessible(true); - return (Map) nesField.get(eventSourceTopology); - } - }