public void testAllocationStateStatic() { AddClusterOptions options = allocationState(AllocationState.ENABLED); assertEquals(ImmutableList.of("Enabled"), options.buildQueryParameters().get("allocationstate")); }
public void testPasswordStatic() { AddClusterOptions options = password("sekrit"); assertEquals(ImmutableList.of("sekrit"), options.buildQueryParameters().get("password")); }
public void testPodIdStatic() { AddClusterOptions options = podId("42"); assertEquals(ImmutableList.of("42"), options.buildQueryParameters().get("podid")); }
public void testUrlStatic() { AddClusterOptions options = url("http://example.com"); assertEquals(ImmutableList.of("http://example.com"), options.buildQueryParameters().get("url")); }
public void testUsernameStatic() { AddClusterOptions options = username("fred"); assertEquals(ImmutableList.of("fred"), options.buildQueryParameters().get("username")); }
@Test public void testAddClusterWhenResponseIs2xx() { HttpResponse response = HttpResponse.builder() .payload(payloadFromResource("/addclusterresponse.json")) .statusCode(200).build(); Cluster expected = Cluster.builder().id("1").name("Xen Clust 1").podId("1").podName("Dev Pod 1").zoneId("1").zoneName("Dev Zone 1").hypervisor("XenServer").clusterType(Host.ClusterType.CLOUD_MANAGED).allocationState(AllocationState.ENABLED).managedState(Cluster.ManagedState.MANAGED).build(); Cluster actual = requestSendsResponse(addCluster, response).addCluster("1", "Xen Clust 1", Host.ClusterType.CLOUD_MANAGED, "XenServer", AddClusterOptions.Builder.allocationState(AllocationState.ENABLED).podId("1").url("http://example.com/cluster").username("fred").password("sekrit")); assertEquals(actual, expected); }
public void testPasswordStatic() { AddClusterOptions options = password("sekrit"); assertEquals(ImmutableList.of("sekrit"), options.buildQueryParameters().get("password")); }
public void testPodIdStatic() { AddClusterOptions options = podId("42"); assertEquals(ImmutableList.of("42"), options.buildQueryParameters().get("podid")); }
public void testUrlStatic() { AddClusterOptions options = url("http://example.com"); assertEquals(ImmutableList.of("http://example.com"), options.buildQueryParameters().get("url")); }
public void testAllocationStateStatic() { AddClusterOptions options = allocationState(AllocationState.ENABLED); assertEquals(ImmutableList.of("Enabled"), options.buildQueryParameters().get("allocationstate")); }
@Test public void testAddClusterWhenResponseIs2xx() { HttpResponse response = HttpResponse.builder() .payload(payloadFromResource("/addclusterresponse.json")) .statusCode(200).build(); Cluster expected = Cluster.builder().id("1").name("Xen Clust 1").podId("1").podName("Dev Pod 1").zoneId("1").zoneName("Dev Zone 1").hypervisor("XenServer").clusterType(Host.ClusterType.CLOUD_MANAGED).allocationState(AllocationState.ENABLED).managedState(Cluster.ManagedState.MANAGED).build(); Cluster actual = requestSendsResponse(addCluster, response).addCluster("1", "Xen Clust 1", Host.ClusterType.CLOUD_MANAGED, "XenServer", AddClusterOptions.Builder.allocationState(AllocationState.ENABLED).podId("1").url("http://example.com/cluster").username("fred").password("sekrit")); assertEquals(actual, expected); }
public void testUsernameStatic() { AddClusterOptions options = username("fred"); assertEquals(ImmutableList.of("fred"), options.buildQueryParameters().get("username")); }