use of com.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest in project java-monitoring by googleapis.
the class NotificationChannelServiceClientTest method getNotificationChannelVerificationCodeTest.
@Test
public void getNotificationChannelVerificationCodeTest() throws Exception {
GetNotificationChannelVerificationCodeResponse expectedResponse = GetNotificationChannelVerificationCodeResponse.newBuilder().setCode("code3059181").setExpireTime(Timestamp.newBuilder().build()).build();
mockNotificationChannelService.addResponse(expectedResponse);
NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
GetNotificationChannelVerificationCodeResponse actualResponse = client.getNotificationChannelVerificationCode(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockNotificationChannelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetNotificationChannelVerificationCodeRequest actualRequest = ((GetNotificationChannelVerificationCodeRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest in project java-monitoring by googleapis.
the class NotificationChannelServiceClientTest method getNotificationChannelVerificationCodeTest2.
@Test
public void getNotificationChannelVerificationCodeTest2() throws Exception {
GetNotificationChannelVerificationCodeResponse expectedResponse = GetNotificationChannelVerificationCodeResponse.newBuilder().setCode("code3059181").setExpireTime(Timestamp.newBuilder().build()).build();
mockNotificationChannelService.addResponse(expectedResponse);
String name = "name3373707";
GetNotificationChannelVerificationCodeResponse actualResponse = client.getNotificationChannelVerificationCode(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockNotificationChannelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetNotificationChannelVerificationCodeRequest actualRequest = ((GetNotificationChannelVerificationCodeRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations