ClusterMembership { public static ClusterMembership from(String stringValue, Version vespaVersion, Optional<DockerImage> dockerImageRepo) { return new ClusterMembership(stringValue, vespaVersion, dockerImageRepo); } protected  ClusterMembership(); private  ClusterMembership(String stringValue, Version vespaVersion, Optional<DockerImage> dockerImageRepo); private  ClusterMembership(ClusterSpec cluster, int index, boolean retired); ClusterSpec cluster(); int index(); boolean retired(); ClusterMembership retire(); ClusterMembership unretire(); ClusterMembership with(ClusterSpec newCluster); String stringValue(); @Override int hashCode(); @Override boolean equals(Object other); @Override String toString(); static ClusterMembership from(String stringValue, Version vespaVersion, Optional<DockerImage> dockerImageRepo); static ClusterMembership from(ClusterSpec cluster, int index); static ClusterMembership retiredFrom(ClusterSpec cluster, int index);  }
@Test public void testContainerServiceInstance() { ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("id1")).vespaVersion("6.42").build(); assertContainerService(ClusterMembership.from(cluster, 3)); }
@Test public void testServiceInstance() { ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("id1")).vespaVersion("6.42").build(); assertContentService(ClusterMembership.from(cluster, 37)); }
@Test public void testServiceInstanceWithGroup() { ClusterSpec cluster = ClusterSpec.specification(ClusterSpec.Type.content, ClusterSpec.Id.from("id1")) .group(ClusterSpec.Group.from(4)) .vespaVersion("6.42") .build(); assertContentServiceWithGroup(ClusterMembership.from(cluster, 37)); }
@Test public void testServiceInstanceWithGroupFromString() { assertContentServiceWithGroup(ClusterMembership.from("content/id1/4/37", Vtag.currentVersion, Optional.empty())); }
@Test public void testServiceInstanceWithGroupAndRetireFromString() { assertContentServiceWithGroupAndRetire(ClusterMembership.from("content/id1/4/37/retired", Vtag.currentVersion, Optional.empty())); }