Search in sources :

Example 1 with ConnectorUri

use of org.neo4j.causalclustering.discovery.ClientConnectorAddresses.ConnectorUri in project neo4j by neo4j.

the class ClientConnectorAddressesTest method shouldSerializeToString.

@Test
public void shouldSerializeToString() throws Exception {
    // given
    ClientConnectorAddresses connectorAddresses = new ClientConnectorAddresses(asList(new ConnectorUri(bolt, new AdvertisedSocketAddress("host", 1)), new ConnectorUri(http, new AdvertisedSocketAddress("host", 2)), new ConnectorUri(https, new AdvertisedSocketAddress("host", 3))));
    // when
    ClientConnectorAddresses out = ClientConnectorAddresses.fromString(connectorAddresses.toString());
    // then
    assertEquals(connectorAddresses, out);
}
Also used : AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) ConnectorUri(org.neo4j.causalclustering.discovery.ClientConnectorAddresses.ConnectorUri) Test(org.junit.Test)

Example 2 with ConnectorUri

use of org.neo4j.causalclustering.discovery.ClientConnectorAddresses.ConnectorUri in project neo4j by neo4j.

the class ClientConnectorAddressesTest method shouldSerializeWithNoHttpsAddress.

@Test
public void shouldSerializeWithNoHttpsAddress() throws Exception {
    // given
    ClientConnectorAddresses connectorAddresses = new ClientConnectorAddresses(asList(new ConnectorUri(bolt, new AdvertisedSocketAddress("host", 1)), new ConnectorUri(http, new AdvertisedSocketAddress("host", 2))));
    // when
    ClientConnectorAddresses out = ClientConnectorAddresses.fromString(connectorAddresses.toString());
    // then
    assertEquals(connectorAddresses, out);
}
Also used : AdvertisedSocketAddress(org.neo4j.helpers.AdvertisedSocketAddress) ConnectorUri(org.neo4j.causalclustering.discovery.ClientConnectorAddresses.ConnectorUri) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ConnectorUri (org.neo4j.causalclustering.discovery.ClientConnectorAddresses.ConnectorUri)2 AdvertisedSocketAddress (org.neo4j.helpers.AdvertisedSocketAddress)2