@Test
public void testGetPublishingEventNode() throws Exception
{

    NodeRef eventNode= helper.getPublishingEventNode(null);
    assertNull("If id is null event shoudl be null!", eventNode);
    
    eventNode= helper.getPublishingEventNode("foo");
    assertNull("If id is invalid event shoudl be null!", eventNode);
    
    String nonExistantId = "foo://bar/nonExistantId";
    eventNode= helper.getPublishingEventNode(nonExistantId);
    assertNull("If event node does not exist event shoudl be null!", eventNode);
    
    String nonPublishingEventId = "foo://bar/nonPublishingEventId";
    NodeRef nonPublishingEventNode = new NodeRef(nonPublishingEventId);
    when(nodeService.exists(nonPublishingEventNode)).thenReturn(true);
    
    eventNode= helper.getPublishingEventNode(nonPublishingEventId);
    assertNull("Event shoudl exist!", eventNode);
    
    String publishingEventId = "foo://bar/publishingEventId";
    NodeRef publishingEventNode = new NodeRef(publishingEventId);
    when(nodeService.exists(publishingEventNode)).thenReturn(true);
    when(nodeService.getType(publishingEventNode)).thenReturn(TYPE_PUBLISHING_EVENT);
    
    eventNode= helper.getPublishingEventNode(publishingEventId);
    assertNotNull("Event shoudl exist!", eventNode);
}