@FixFor( "MODE-1370" )
@Test
public void shouldReceiveUserDataWithEventWhenObservationSessionIsSameThatMadeChange() throws Exception {

    // register listener
    SimpleListener listener = addListener(1, Event.NODE_ADDED, null, false, null, null, false);
    // add node
    Node addedNode = getRoot().addNode("node1", UNSTRUCTURED);
    // Add user-data to the observation manager ...
    String userData = "my user data";
    getRoot().getSession().getWorkspace().getObservationManager().setUserData(userData);
    save();
    // event handling
    listener.waitForEvents();
    removeListener(listener);
    // tests
    checkResults(listener);
    assertTrue("Path for added node is wrong: actual=" + listener.getEvents().get(0).getPath() + ", expected="
               + addedNode.getPath(),
               containsPath(listener, addedNode.getPath()));
    // Now check the userdata in the events ...
    for (Event event : listener.events) {
        String eventUserData = event.getUserData();
        assertThat(eventUserData, is(userData));
    }
    // Now check the userdata ...
    assertThat(listener.userData.size(), is(not(0)));
    for (String receivedUserData : listener.userData) {
        assertThat(receivedUserData, is(userData));
    }
}