@Test
public void testExport() throws Exception {

    service.export();
    assertThat(service.getExportedUrls(), hasSize(1));
    URL url = service.toUrl();
    assertThat(url.getProtocol(), equalTo("mockprotocol2"));
    assertThat(url.getPath(), equalTo(DemoService.class.getName()));
    assertThat(url.getParameters(), hasEntry(ANYHOST_KEY, "true"));
    assertThat(url.getParameters(), hasEntry(APPLICATION_KEY, "app"));
    assertThat(url.getParameters(), hasKey(BIND_IP_KEY));
    assertThat(url.getParameters(), hasKey(BIND_PORT_KEY));
    assertThat(url.getParameters(), hasEntry(EXPORT_KEY, "true"));
    assertThat(url.getParameters(), hasEntry("echo.0.callback", "false"));
    assertThat(url.getParameters(), hasEntry(GENERIC_KEY, "false"));
    assertThat(url.getParameters(), hasEntry(INTERFACE_KEY, DemoService.class.getName()));
    assertThat(url.getParameters(), hasKey(METHODS_KEY));
    assertThat(url.getParameters().get(METHODS_KEY), containsString("echo"));
    assertThat(url.getParameters(), hasEntry(SIDE_KEY, PROVIDER));
    Mockito.verify(protocolDelegate).export(Mockito.any(Invoker.class));
}