Search in sources :

Example 6 with Endpoint

use of org.neo4j.causalclustering.load_balancing.Endpoint in project neo4j by neo4j.

the class ResultFormatV1Test method shouldSerializeToAndFromRecordFormatWithNoEntries.

@Test
public void shouldSerializeToAndFromRecordFormatWithNoEntries() throws Exception {
    // given
    List<Endpoint> writers = emptyList();
    List<Endpoint> readers = emptyList();
    List<Endpoint> routers = emptyList();
    long ttlSeconds = 0;
    LoadBalancingResult original = new LoadBalancingResult(routers, writers, readers, ttlSeconds * 1000);
    // when
    Object[] record = ResultFormatV1.build(original);
    // then
    LoadBalancingResult parsed = ResultFormatV1.parse(record);
    assertEquals(original, parsed);
}
Also used : LoadBalancingResult(org.neo4j.causalclustering.load_balancing.LoadBalancingResult) Endpoint(org.neo4j.causalclustering.load_balancing.Endpoint) Test(org.junit.Test)

Aggregations

Endpoint (org.neo4j.causalclustering.load_balancing.Endpoint)6 LoadBalancingResult (org.neo4j.causalclustering.load_balancing.LoadBalancingResult)4 Test (org.junit.Test)3 List (java.util.List)2 NoLeaderFoundException (org.neo4j.causalclustering.core.consensus.NoLeaderFoundException)2 MemberId (org.neo4j.causalclustering.identity.MemberId)2 AdvertisedSocketAddress (org.neo4j.helpers.AdvertisedSocketAddress)2 ArrayList (java.util.ArrayList)1 Collections.emptyList (java.util.Collections.emptyList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Collectors.toList (java.util.stream.Collectors.toList)1 CausalClusteringSettings (org.neo4j.causalclustering.core.CausalClusteringSettings)1 LeaderLocator (org.neo4j.causalclustering.core.consensus.LeaderLocator)1 CoreServerInfo (org.neo4j.causalclustering.discovery.CoreServerInfo)1 CoreTopology (org.neo4j.causalclustering.discovery.CoreTopology)1 ReadReplicaTopology (org.neo4j.causalclustering.discovery.ReadReplicaTopology)1