Search in sources :

Example 1 with GetUptimeCheckConfigRequest

use of com.google.monitoring.v3.GetUptimeCheckConfigRequest in project java-monitoring by googleapis.

the class UptimeCheckServiceClientTest method getUptimeCheckConfigTest2.

@Test
public void getUptimeCheckConfigTest2() throws Exception {
    UptimeCheckConfig expectedResponse = UptimeCheckConfig.newBuilder().setName(UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]").toString()).setDisplayName("displayName1714148973").setPeriod(Duration.newBuilder().build()).setTimeout(Duration.newBuilder().build()).addAllContentMatchers(new ArrayList<UptimeCheckConfig.ContentMatcher>()).addAllSelectedRegions(new ArrayList<UptimeCheckRegion>()).setIsInternal(true).addAllInternalCheckers(new ArrayList<InternalChecker>()).build();
    mockUptimeCheckService.addResponse(expectedResponse);
    String name = "name3373707";
    UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockUptimeCheckService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetUptimeCheckConfigRequest actualRequest = ((GetUptimeCheckConfigRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) GetUptimeCheckConfigRequest(com.google.monitoring.v3.GetUptimeCheckConfigRequest) UptimeCheckConfig(com.google.monitoring.v3.UptimeCheckConfig) Test(org.junit.Test)

Example 2 with GetUptimeCheckConfigRequest

use of com.google.monitoring.v3.GetUptimeCheckConfigRequest in project java-monitoring by googleapis.

the class UptimeCheckServiceClientTest method getUptimeCheckConfigTest.

@Test
public void getUptimeCheckConfigTest() throws Exception {
    UptimeCheckConfig expectedResponse = UptimeCheckConfig.newBuilder().setName(UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]").toString()).setDisplayName("displayName1714148973").setPeriod(Duration.newBuilder().build()).setTimeout(Duration.newBuilder().build()).addAllContentMatchers(new ArrayList<UptimeCheckConfig.ContentMatcher>()).addAllSelectedRegions(new ArrayList<UptimeCheckRegion>()).setIsInternal(true).addAllInternalCheckers(new ArrayList<InternalChecker>()).build();
    mockUptimeCheckService.addResponse(expectedResponse);
    UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockUptimeCheckService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetUptimeCheckConfigRequest actualRequest = ((GetUptimeCheckConfigRequest) actualRequests.get(0));
    Assert.assertEquals(name.toString(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) GetUptimeCheckConfigRequest(com.google.monitoring.v3.GetUptimeCheckConfigRequest) UptimeCheckConfig(com.google.monitoring.v3.UptimeCheckConfig) UptimeCheckConfigName(com.google.monitoring.v3.UptimeCheckConfigName) Test(org.junit.Test)

Aggregations

GetUptimeCheckConfigRequest (com.google.monitoring.v3.GetUptimeCheckConfigRequest)2 UptimeCheckConfig (com.google.monitoring.v3.UptimeCheckConfig)2 AbstractMessage (com.google.protobuf.AbstractMessage)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 UptimeCheckConfigName (com.google.monitoring.v3.UptimeCheckConfigName)1