Search in sources :

Example 1 with Membership

use of com.cloudant.client.api.model.Membership in project java-cloudant by cloudant.

the class CloudantClientTests method cookieTest.

@Test
@RequiresCloudant
public void cookieTest() {
    Membership membership = account.getMembership();
    assertNotNull(membership);
}
Also used : Membership(com.cloudant.client.api.model.Membership) Test(org.junit.jupiter.api.Test) RequiresCloudant(com.cloudant.test.main.RequiresCloudant)

Example 2 with Membership

use of com.cloudant.client.api.model.Membership in project java-cloudant by cloudant.

the class CloudantClientTests method membership.

@Test
@RequiresCloudant
public void membership() {
    Membership mship = account.getMembership();
    assertNotNull(mship);
    assertNotNull(mship.getClusterNodes());
    assertNotNull(mship.getClusterNodes().hasNext());
    assertNotNull(mship.getAllNodes());
    assertNotNull(mship.getAllNodes().hasNext());
}
Also used : Membership(com.cloudant.client.api.model.Membership) Test(org.junit.jupiter.api.Test) RequiresCloudant(com.cloudant.test.main.RequiresCloudant)

Example 3 with Membership

use of com.cloudant.client.api.model.Membership in project java-cloudant by cloudant.

the class CloudantClient method getMembership.

/**
 * Get the list of all nodes and the list of active nodes in the cluster.
 *
 * @return Membership object encapsulating lists of all nodes and the cluster nodes
 * @see <a
 * href="https://console.bluemix.net/docs/services/Cloudant/api/advanced.html#-get-_membership-">
 * _membership</a>
 */
public Membership getMembership() {
    URI uri = new URIBase(getBaseUri()).path("_membership").build();
    Membership membership = couchDbClient.get(uri, Membership.class);
    return membership;
}
Also used : Membership(com.cloudant.client.api.model.Membership) URI(java.net.URI) URIBase(com.cloudant.client.internal.URIBase)

Aggregations

Membership (com.cloudant.client.api.model.Membership)3 RequiresCloudant (com.cloudant.test.main.RequiresCloudant)2 Test (org.junit.jupiter.api.Test)2 URIBase (com.cloudant.client.internal.URIBase)1 URI (java.net.URI)1