@Test public void testListGlobalOperations() { Page<Operation> operationPage = compute.listGlobalOperations(); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertNotNull(operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListGlobalOperationsWithFilter() { Page<Operation> operationPage = compute.listGlobalOperations( Compute.OperationListOption.filter( Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertEquals(Operation.Status.DONE, operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListZoneOperations() { Page<Operation> operationPage = compute.listZoneOperations(ZONE); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertNotNull(operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListRegionOperations() { Page<Operation> operationPage = compute.listRegionOperations(REGION); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(REGION, operation.<RegionOperationId>getOperationId().getRegion()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertNotNull(operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListRegionOperationsWithFilter() { Page<Operation> operationPage = compute.listRegionOperations( REGION, Compute.OperationListOption.filter( Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(REGION, operation.<RegionOperationId>getOperationId().getRegion()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertEquals(Operation.Status.DONE, operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListZoneOperationsWithFilter() { Page<Operation> operationPage = compute.listZoneOperations( ZONE, Compute.OperationListOption.filter( Compute.OperationFilter.equals(Compute.OperationField.STATUS, "DONE"))); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone()); // todo(mziccard): uncomment or remove once #727 is closed // assertNotNull(operation.getCreationTimestamp()); assertNotNull(operation.getOperationType()); assertEquals(Operation.Status.DONE, operation.getStatus()); assertNotNull(operation.getUser()); } }
@Test public void testListGlobalOperationsWithSelectedFields() { Page<Operation> operationPage = compute.listGlobalOperations(Compute.OperationListOption.fields(Compute.OperationField.ID)); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertNull(operation.getOperationType()); assertNull(operation.getTargetLink()); assertNull(operation.getTargetId()); assertNull(operation.getOperationType()); assertNull(operation.getStatus()); assertNull(operation.getStatusMessage()); assertNull(operation.getUser()); assertNull(operation.getProgress()); assertNull(operation.getDescription()); assertNull(operation.getInsertTime()); assertNull(operation.getStartTime()); assertNull(operation.getEndTime()); assertNull(operation.getWarnings()); assertNull(operation.getHttpErrorMessage()); } }
@Test public void testListZoneOperationsWithSelectedFields() { Page<Operation> operationPage = compute.listZoneOperations( ZONE, Compute.OperationListOption.fields(Compute.OperationField.ID)); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(ZONE, operation.<ZoneOperationId>getOperationId().getZone()); assertNull(operation.getOperationType()); assertNull(operation.getTargetLink()); assertNull(operation.getTargetId()); assertNull(operation.getOperationType()); assertNull(operation.getStatus()); assertNull(operation.getStatusMessage()); assertNull(operation.getUser()); assertNull(operation.getProgress()); assertNull(operation.getDescription()); assertNull(operation.getInsertTime()); assertNull(operation.getStartTime()); assertNull(operation.getEndTime()); assertNull(operation.getWarnings()); assertNull(operation.getHttpErrorMessage()); } }
@Test public void testListRegionOperationsWithSelectedFields() { Page<Operation> operationPage = compute.listRegionOperations( REGION, Compute.OperationListOption.fields(Compute.OperationField.ID)); Iterator<Operation> operationIterator = operationPage.iterateAll().iterator(); while (operationIterator.hasNext()) { Operation operation = operationIterator.next(); assertNotNull(operation.getGeneratedId()); assertNotNull(operation.getOperationId()); assertEquals(REGION, operation.<RegionOperationId>getOperationId().getRegion()); assertNull(operation.getOperationType()); assertNull(operation.getTargetLink()); assertNull(operation.getTargetId()); assertNull(operation.getOperationType()); assertNull(operation.getStatus()); assertNull(operation.getStatusMessage()); assertNull(operation.getUser()); assertNull(operation.getProgress()); assertNull(operation.getDescription()); assertNull(operation.getInsertTime()); assertNull(operation.getStartTime()); assertNull(operation.getEndTime()); assertNull(operation.getWarnings()); assertNull(operation.getHttpErrorMessage()); } }
private void assertNullCommonFields(Operation operation) { assertNull(operation.getGeneratedId()); assertNull(operation.getClientOperationId()); assertNull(operation.getOperationType()); assertNull(operation.getTargetLink()); assertNull(operation.getTargetId()); assertNull(operation.getStatus()); assertNull(operation.getStatusMessage()); assertNull(operation.getUser()); assertNull(operation.getProgress()); assertNull(operation.getInsertTime()); assertNull(operation.getStartTime()); assertNull(operation.getEndTime()); assertNull(operation.getErrors()); assertNull(operation.getWarnings()); assertNull(operation.getHttpErrorStatusCode()); assertNull(operation.getHttpErrorMessage()); assertNull(operation.getDescription()); assertSame(serviceMockReturnsOptions, operation.getCompute()); }
private void assertEqualsCommonFields(Operation operation) { assertEquals(GENERATED_ID, operation.getGeneratedId()); assertEquals(CLIENT_OPERATION_ID, operation.getClientOperationId()); assertEquals(OPERATION_TYPE, operation.getOperationType()); assertEquals(TARGET_LINK, operation.getTargetLink()); assertEquals(TARGET_ID, operation.getTargetId()); assertEquals(STATUS, operation.getStatus()); assertEquals(STATUS_MESSAGE, operation.getStatusMessage()); assertEquals(USER, operation.getUser()); assertEquals(PROGRESS, operation.getProgress()); assertEquals(INSERT_TIME, operation.getInsertTime()); assertEquals(START_TIME, operation.getStartTime()); assertEquals(END_TIME, operation.getEndTime()); assertEquals(ERRORS, operation.getErrors()); assertEquals(WARNINGS, operation.getWarnings()); assertEquals(HTTP_ERROR_STATUS_CODE, globalOperation.getHttpErrorStatusCode()); assertEquals(HTTP_ERROR_MESSAGE, globalOperation.getHttpErrorMessage()); assertEquals(DESCRIPTION, globalOperation.getDescription()); assertSame(serviceMockReturnsOptions, globalOperation.getCompute()); }