@Test public void testCreatePod() { skipIfNotGlobalAdmin(); zone = globalAdminClient.getZoneApi().createZone(prefix + "-zone-for-pod", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"); pod = globalAdminClient.getPodClient().createPod(prefix + "-pod", zone.getId(), "172.20.0.1", "172.20.0.250", "172.20.0.254", "255.255.255.0", CreatePodOptions.Builder.allocationState(AllocationState.ENABLED)); assertNotNull(pod); assertEquals(pod.getName(), prefix + "-pod"); assertEquals(pod.getZoneId(), zone.getId()); assertEquals(pod.getZoneName(), prefix + "-zone-for-pod"); assertEquals(pod.getStartIp(), "172.20.0.1"); assertEquals(pod.getEndIp(), "172.20.0.250"); assertEquals(pod.getGateway(), "172.20.0.254"); assertEquals(pod.getNetmask(), "255.255.255.0"); assertEquals(pod.getAllocationState(), AllocationState.ENABLED); }
public void testCreatePodWhenResponseIs2xx() { GlobalPodApi client = requestSendsResponse(createPod, HttpResponse.builder() .statusCode(200) .payload(payloadFromResource("/createpodresponse.json")) .build()); Pod expected = Pod.builder() .id("6") .name("richard-pod") .zoneId("10") .zoneName("richard-zone") .gateway("172.20.0.254") .netmask("255.255.255.0") .startIp("172.20.0.1") .endIp("172.20.0.250") .allocationState(AllocationState.ENABLED) .build(); Pod actual = client.createPod("richard-pod", "10", "172.20.0.1", "172.20.0.250", "172.20.0.254", "255.255.255.0", CreatePodOptions.Builder.allocationState(AllocationState.ENABLED)); assertEquals(actual, expected); }
public void testCreatePodWhenResponseIs2xx() { GlobalPodClient client = requestSendsResponse(createPod, HttpResponse.builder() .statusCode(200) .payload(payloadFromResource("/createpodresponse.json")) .build()); Pod expected = Pod.builder() .id("6") .name("richard-pod") .zoneId("10") .zoneName("richard-zone") .gateway("172.20.0.254") .netmask("255.255.255.0") .startIp("172.20.0.1") .endIp("172.20.0.250") .allocationState(AllocationState.ENABLED) .build(); Pod actual = client.createPod("richard-pod", "10", "172.20.0.1", "172.20.0.250", "172.20.0.254", "255.255.255.0", CreatePodOptions.Builder.allocationState(AllocationState.ENABLED)); assertEquals(actual, expected); }
@Test public void testCreatePod() { skipIfNotGlobalAdmin(); zone = globalAdminClient.getZoneClient().createZone(prefix + "-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10"); pod = globalAdminClient.getPodClient().createPod(prefix + "-pod", zone.getId(), "172.20.0.1", "172.20.0.250", "172.20.0.254", "255.255.255.0", CreatePodOptions.Builder.allocationState(AllocationState.ENABLED)); assertNotNull(pod); assertEquals(pod.getName(), prefix + "-pod"); assertEquals(pod.getZoneId(), zone.getId()); assertEquals(pod.getZoneName(), prefix + "-zone"); assertEquals(pod.getStartIp(), "172.20.0.1"); assertEquals(pod.getEndIp(), "172.20.0.250"); assertEquals(pod.getGateway(), "172.20.0.254"); assertEquals(pod.getNetmask(), "255.255.255.0"); assertEquals(pod.getAllocationState(), AllocationState.ENABLED); }
public void testAllocationStateStatic() { CreatePodOptions options = allocationState(AllocationState.ENABLED); assertEquals(ImmutableList.of("Enabled"), options.buildQueryParameters().get("allocationstate")); }
public void testAllocationStateStatic() { CreatePodOptions options = allocationState(AllocationState.ENABLED); assertEquals(ImmutableList.of("Enabled"), options.buildQueryParameters().get("allocationstate")); }