Search in sources :

Example 11 with Metric

use of com.google.cloud.logging.Metric in project google-cloud-java by GoogleCloudPlatform.

the class ITMetricSnippets method testMetric.

@Test
public void testMetric() throws InterruptedException, ExecutionException {
    Metric metric = metricSnippets.reload();
    assertNotNull(metric);
    Metric updatedMetric = metricSnippets.update();
    assertEquals(UPDATED_DESCRIPTION, updatedMetric.getDescription());
    updatedMetric = metricSnippets.reloadAsync();
    assertNotNull(updatedMetric);
    assertEquals(UPDATED_DESCRIPTION, updatedMetric.getDescription());
    metric.update();
    updatedMetric = metricSnippets.updateAsync();
    assertEquals(UPDATED_DESCRIPTION, updatedMetric.getDescription());
    assertTrue(metricSnippets.delete());
    assertFalse(metricSnippets.deleteAsync());
}
Also used : Metric(com.google.cloud.logging.Metric) Test(org.junit.Test)

Aggregations

Metric (com.google.cloud.logging.Metric)11 MetricInfo (com.google.cloud.logging.MetricInfo)5 Test (org.junit.Test)2 AsyncPage (com.google.api.gax.paging.AsyncPage)1 Logging (com.google.cloud.logging.Logging)1