@Test
public void registerEventSourceTest() throws Exception {

    topicTestHelper();
    Node nodeMock = mock(Node.class);
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    NodeKey nodeKey = new NodeKey(nodeId);
    doReturn(nodeKey).when(nodeMock).key();
    doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
    ObjectRegistration routedRpcRegistrationMock = mock(ObjectRegistration.class);
    doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock)
            .registerRpcImplementation(eq(EventSourceService.class), eq(eventSourceMock), any(Set.class));
    assertNotNull("Return value has not been created correctly.",
            eventSourceTopology.registerEventSource(eventSourceMock));
}