@Test
public void testPublishNotification() throws Exception {

    final EndpointDescription epd = dummyEndpoint();
    Endpoint endpoint = c.createMock(Endpoint.class);
    expect(endpoint.description()).andReturn(epd);
    final ServiceReference sref = c.createMock(ServiceReference.class);
    c.replay();
    EventProducer eventProducer = new EventProducer(bc);
    ExportRegistrationImpl ereg = new ExportRegistrationImpl(sref, endpoint, closeHandler, eventProducer);
    eventProducer.publishNotification(ereg);
    RemoteServiceAdminEvent rsae = capturedEvent.getValue();
    Assert.assertNull(rsae.getException());
    Assert.assertEquals(RemoteServiceAdminEvent.EXPORT_REGISTRATION, rsae.getType());
    Assert.assertSame(bundle, rsae.getSource());
    ExportReference er = rsae.getExportReference();
    Assert.assertSame(epd, er.getExportedEndpoint());
    Assert.assertSame(sref, er.getExportedService());
    c.verify();
}