'Make sure that client events handled securely.'

def testClientEventNotification(self):

    ClientListener.received_events = []
    NoClientListener.received_events = []
    event = rdf_flows.GrrMessage(source='C.1395c448a443c7d9', auth_state=rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED)
    event.payload = rdf_paths.PathSpec(path='foobar')
    events.Events.PublishEvent('TestEvent', event, token=self.token)
    worker_test_lib.MockWorker(token=self.token).Simulate()
    self.assertRDFValuesEqual(ClientListener.received_events[0][0].payload, event.payload)
    self.assertEqual(NoClientListener.received_events, [])
