use of com.google.monitoring.v3.GetNotificationChannelDescriptorRequest in project java-monitoring by googleapis.
the class NotificationChannelServiceClientTest method getNotificationChannelDescriptorTest2.
@Test
public void getNotificationChannelDescriptorTest2() throws Exception {
NotificationChannelDescriptor expectedResponse = NotificationChannelDescriptor.newBuilder().setName(NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]").toString()).setType("type3575610").setDisplayName("displayName1714148973").setDescription("description-1724546052").addAllLabels(new ArrayList<LabelDescriptor>()).addAllSupportedTiers(new ArrayList<ServiceTier>()).setLaunchStage(LaunchStage.forNumber(0)).build();
mockNotificationChannelService.addResponse(expectedResponse);
String name = "name3373707";
NotificationChannelDescriptor actualResponse = client.getNotificationChannelDescriptor(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockNotificationChannelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetNotificationChannelDescriptorRequest actualRequest = ((GetNotificationChannelDescriptorRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.monitoring.v3.GetNotificationChannelDescriptorRequest in project java-monitoring by googleapis.
the class NotificationChannelServiceClientTest method getNotificationChannelDescriptorTest.
@Test
public void getNotificationChannelDescriptorTest() throws Exception {
NotificationChannelDescriptor expectedResponse = NotificationChannelDescriptor.newBuilder().setName(NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]").toString()).setType("type3575610").setDisplayName("displayName1714148973").setDescription("description-1724546052").addAllLabels(new ArrayList<LabelDescriptor>()).addAllSupportedTiers(new ArrayList<ServiceTier>()).setLaunchStage(LaunchStage.forNumber(0)).build();
mockNotificationChannelService.addResponse(expectedResponse);
NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
NotificationChannelDescriptor actualResponse = client.getNotificationChannelDescriptor(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockNotificationChannelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetNotificationChannelDescriptorRequest actualRequest = ((GetNotificationChannelDescriptorRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations