1515 */
1616
1717// DO NOT MODIFY! AUTO-GENERATED!
18- // This file is auto-generated on 2019-04-24 .
18+ // This file is auto-generated on 2019-05-03 .
1919
2020package com .google .cloud .monitoring .v3 ;
2121
@@ -46,8 +46,7 @@ private static boolean isRejected(Delay delayed) {
4646 }
4747
4848 private static void doTest (Delay delayedInside , Delay delayedOutside ) {
49- if ((System .getenv ("GOOGLE_CLOUD_TESTS_IN_VPCSC" ) != null )
50- && (System .getenv ("GOOGLE_CLOUD_TESTS_IN_VPCSC" ).equalsIgnoreCase ("True" ))) {
49+ if ((IS_INSIDE_VPCSC != null ) && (IS_INSIDE_VPCSC .equalsIgnoreCase ("true" ))) {
5150 Assert .assertTrue (isRejected (delayedOutside ));
5251 Assert .assertTrue (!(isRejected (delayedInside )));
5352 } else {
@@ -59,6 +58,7 @@ private static void doTest(Delay delayedInside, Delay delayedOutside) {
5958 static final String PROJECT_OUTSIDE =
6059 System .getenv ("GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_PROJECT" );
6160 static final String PROJECT_INSIDE = System .getenv ("PROJECT_ID" );
61+ static final String IS_INSIDE_VPCSC = System .getenv ("GOOGLE_CLOUD_TESTS_IN_VPCSC" );
6262
6363 @ BeforeClass
6464 public static void setUpClass () {
@@ -553,4 +553,318 @@ public void eval() {
553553 doTest (delayedInside , delayedOutside );
554554 client .close ();
555555 }
556+
557+ @ Test
558+ @ SuppressWarnings ("all" )
559+ public void createNotificationChannelTest () throws Exception {
560+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
561+ final ProjectName nameInside = ProjectName .of (PROJECT_INSIDE );
562+ final NotificationChannel resourceInside = NotificationChannel .newBuilder ().build ();
563+ Delay delayedInside =
564+ new Delay () {
565+ @ Override
566+ public void eval () {
567+ client .createNotificationChannel (nameInside , resourceInside );
568+ }
569+ };
570+ final ProjectName nameOutside = ProjectName .of (PROJECT_OUTSIDE );
571+ final NotificationChannel resourceOutside = NotificationChannel .newBuilder ().build ();
572+ Delay delayedOutside =
573+ new Delay () {
574+ @ Override
575+ public void eval () {
576+ client .createNotificationChannel (nameOutside , resourceOutside );
577+ }
578+ };
579+ doTest (delayedInside , delayedOutside );
580+ client .close ();
581+ }
582+
583+ @ Test
584+ @ SuppressWarnings ("all" )
585+ public void deleteNotificationChannelTest () throws Exception {
586+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
587+ final NotificationChannelName nameInside =
588+ NotificationChannelName .of (PROJECT_INSIDE , "MockNotificationChannel" );
589+ Delay delayedInside =
590+ new Delay () {
591+ @ Override
592+ public void eval () {
593+ client .deleteNotificationChannel (nameInside , true );
594+ }
595+ };
596+ final NotificationChannelName nameOutside =
597+ NotificationChannelName .of (PROJECT_OUTSIDE , "MockNotificationChannel" );
598+ Delay delayedOutside =
599+ new Delay () {
600+ @ Override
601+ public void eval () {
602+ client .deleteNotificationChannel (nameOutside , true );
603+ }
604+ };
605+ doTest (delayedInside , delayedOutside );
606+ client .close ();
607+ }
608+
609+ @ Test
610+ @ SuppressWarnings ("all" )
611+ public void getNotificationChannelTest () throws Exception {
612+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
613+ final NotificationChannelName nameInside =
614+ NotificationChannelName .of (PROJECT_INSIDE , "MockNotificationChannel" );
615+ Delay delayedInside =
616+ new Delay () {
617+ @ Override
618+ public void eval () {
619+ client .getNotificationChannel (nameInside );
620+ }
621+ };
622+ final NotificationChannelName nameOutside =
623+ NotificationChannelName .of (PROJECT_OUTSIDE , "MockNotificationChannel" );
624+ Delay delayedOutside =
625+ new Delay () {
626+ @ Override
627+ public void eval () {
628+ client .getNotificationChannel (nameOutside );
629+ }
630+ };
631+ doTest (delayedInside , delayedOutside );
632+ client .close ();
633+ }
634+
635+ @ Test
636+ @ SuppressWarnings ("all" )
637+ public void getNotificationChannelDescriptorTest () throws Exception {
638+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
639+ final NotificationChannelDescriptorName nameInside =
640+ NotificationChannelDescriptorName .of (PROJECT_INSIDE , "MockNotificationChannelDescriptor" );
641+ Delay delayedInside =
642+ new Delay () {
643+ @ Override
644+ public void eval () {
645+ client .getNotificationChannelDescriptor (nameInside );
646+ }
647+ };
648+ final NotificationChannelDescriptorName nameOutside =
649+ NotificationChannelDescriptorName .of (PROJECT_OUTSIDE , "MockNotificationChannelDescriptor" );
650+ Delay delayedOutside =
651+ new Delay () {
652+ @ Override
653+ public void eval () {
654+ client .getNotificationChannelDescriptor (nameOutside );
655+ }
656+ };
657+ doTest (delayedInside , delayedOutside );
658+ client .close ();
659+ }
660+
661+ @ Test
662+ @ SuppressWarnings ("all" )
663+ public void listNotificationChannelDescriptorsTest () throws Exception {
664+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
665+ final ProjectName nameInside = ProjectName .of (PROJECT_INSIDE );
666+ Delay delayedInside =
667+ new Delay () {
668+ @ Override
669+ public void eval () {
670+ client .listNotificationChannelDescriptors (nameInside );
671+ }
672+ };
673+ final ProjectName nameOutside = ProjectName .of (PROJECT_OUTSIDE );
674+ Delay delayedOutside =
675+ new Delay () {
676+ @ Override
677+ public void eval () {
678+ client .listNotificationChannelDescriptors (nameOutside );
679+ }
680+ };
681+ doTest (delayedInside , delayedOutside );
682+ client .close ();
683+ }
684+
685+ @ Test
686+ @ SuppressWarnings ("all" )
687+ public void listNotificationChannelsTest () throws Exception {
688+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
689+ final ProjectName nameInside = ProjectName .of (PROJECT_INSIDE );
690+ Delay delayedInside =
691+ new Delay () {
692+ @ Override
693+ public void eval () {
694+ client .listNotificationChannels (nameInside );
695+ }
696+ };
697+ final ProjectName nameOutside = ProjectName .of (PROJECT_OUTSIDE );
698+ Delay delayedOutside =
699+ new Delay () {
700+ @ Override
701+ public void eval () {
702+ client .listNotificationChannels (nameOutside );
703+ }
704+ };
705+ doTest (delayedInside , delayedOutside );
706+ client .close ();
707+ }
708+
709+ @ Test
710+ @ SuppressWarnings ("all" )
711+ public void updateNotificationChannelTest () throws Exception {
712+ final NotificationChannelServiceClient client = NotificationChannelServiceClient .create ();
713+ NotificationChannelName nameInside =
714+ NotificationChannelName .of (PROJECT_INSIDE , "MockNotificationChannel" );
715+ final NotificationChannel resourceInside =
716+ NotificationChannel .newBuilder ().setName (nameInside .toString ()).build ();
717+ Delay delayedInside =
718+ new Delay () {
719+ @ Override
720+ public void eval () {
721+ client .updateNotificationChannel (FieldMask .newBuilder ().build (), resourceInside );
722+ }
723+ };
724+ NotificationChannelName nameOutside =
725+ NotificationChannelName .of (PROJECT_OUTSIDE , "MockNotificationChannel" );
726+ final NotificationChannel resourceOutside =
727+ NotificationChannel .newBuilder ().setName (nameOutside .toString ()).build ();
728+ Delay delayedOutside =
729+ new Delay () {
730+ @ Override
731+ public void eval () {
732+ client .updateNotificationChannel (FieldMask .newBuilder ().build (), resourceOutside );
733+ }
734+ };
735+ doTest (delayedInside , delayedOutside );
736+ client .close ();
737+ }
738+
739+ @ Test
740+ @ SuppressWarnings ("all" )
741+ public void createUptimeCheckConfigTest () throws Exception {
742+ final UptimeCheckServiceClient client = UptimeCheckServiceClient .create ();
743+ final ProjectName nameInside = ProjectName .of (PROJECT_INSIDE );
744+ final UptimeCheckConfig resourceInside = UptimeCheckConfig .newBuilder ().build ();
745+ Delay delayedInside =
746+ new Delay () {
747+ @ Override
748+ public void eval () {
749+ client .createUptimeCheckConfig (nameInside .toString (), resourceInside );
750+ }
751+ };
752+ final ProjectName nameOutside = ProjectName .of (PROJECT_OUTSIDE );
753+ final UptimeCheckConfig resourceOutside = UptimeCheckConfig .newBuilder ().build ();
754+ Delay delayedOutside =
755+ new Delay () {
756+ @ Override
757+ public void eval () {
758+ client .createUptimeCheckConfig (nameOutside .toString (), resourceOutside );
759+ }
760+ };
761+ doTest (delayedInside , delayedOutside );
762+ client .close ();
763+ }
764+
765+ @ Test
766+ @ SuppressWarnings ("all" )
767+ public void deleteUptimeCheckConfigTest () throws Exception {
768+ final UptimeCheckServiceClient client = UptimeCheckServiceClient .create ();
769+ final UptimeCheckConfigName nameInside =
770+ UptimeCheckConfigName .of (PROJECT_INSIDE , "MockUptimeCheckConfig" );
771+ Delay delayedInside =
772+ new Delay () {
773+ @ Override
774+ public void eval () {
775+ client .deleteUptimeCheckConfig (nameInside );
776+ }
777+ };
778+ final UptimeCheckConfigName nameOutside =
779+ UptimeCheckConfigName .of (PROJECT_OUTSIDE , "MockUptimeCheckConfig" );
780+ Delay delayedOutside =
781+ new Delay () {
782+ @ Override
783+ public void eval () {
784+ client .deleteUptimeCheckConfig (nameOutside );
785+ }
786+ };
787+ doTest (delayedInside , delayedOutside );
788+ client .close ();
789+ }
790+
791+ @ Test
792+ @ SuppressWarnings ("all" )
793+ public void getUptimeCheckConfigTest () throws Exception {
794+ final UptimeCheckServiceClient client = UptimeCheckServiceClient .create ();
795+ final UptimeCheckConfigName nameInside =
796+ UptimeCheckConfigName .of (PROJECT_INSIDE , "MockUptimeCheckConfig" );
797+ Delay delayedInside =
798+ new Delay () {
799+ @ Override
800+ public void eval () {
801+ client .getUptimeCheckConfig (nameInside );
802+ }
803+ };
804+ final UptimeCheckConfigName nameOutside =
805+ UptimeCheckConfigName .of (PROJECT_OUTSIDE , "MockUptimeCheckConfig" );
806+ Delay delayedOutside =
807+ new Delay () {
808+ @ Override
809+ public void eval () {
810+ client .getUptimeCheckConfig (nameOutside );
811+ }
812+ };
813+ doTest (delayedInside , delayedOutside );
814+ client .close ();
815+ }
816+
817+ @ Test
818+ @ SuppressWarnings ("all" )
819+ public void listUptimeCheckConfigsTest () throws Exception {
820+ final UptimeCheckServiceClient client = UptimeCheckServiceClient .create ();
821+ final ProjectName nameInside = ProjectName .of (PROJECT_INSIDE );
822+ Delay delayedInside =
823+ new Delay () {
824+ @ Override
825+ public void eval () {
826+ client .listUptimeCheckConfigs (nameInside .toString ());
827+ }
828+ };
829+ final ProjectName nameOutside = ProjectName .of (PROJECT_OUTSIDE );
830+ Delay delayedOutside =
831+ new Delay () {
832+ @ Override
833+ public void eval () {
834+ client .listUptimeCheckConfigs (nameOutside .toString ());
835+ }
836+ };
837+ doTest (delayedInside , delayedOutside );
838+ client .close ();
839+ }
840+
841+ @ Test
842+ @ SuppressWarnings ("all" )
843+ public void updateUptimeCheckConfigTest () throws Exception {
844+ final UptimeCheckServiceClient client = UptimeCheckServiceClient .create ();
845+ UptimeCheckConfigName nameInside =
846+ UptimeCheckConfigName .of (PROJECT_INSIDE , "MockUptimeCheckConfig" );
847+ final UptimeCheckConfig resourceInside =
848+ UptimeCheckConfig .newBuilder ().setName (nameInside .toString ()).build ();
849+ Delay delayedInside =
850+ new Delay () {
851+ @ Override
852+ public void eval () {
853+ client .updateUptimeCheckConfig (resourceInside );
854+ }
855+ };
856+ UptimeCheckConfigName nameOutside =
857+ UptimeCheckConfigName .of (PROJECT_OUTSIDE , "MockUptimeCheckConfig" );
858+ final UptimeCheckConfig resourceOutside =
859+ UptimeCheckConfig .newBuilder ().setName (nameOutside .toString ()).build ();
860+ Delay delayedOutside =
861+ new Delay () {
862+ @ Override
863+ public void eval () {
864+ client .updateUptimeCheckConfig (resourceOutside );
865+ }
866+ };
867+ doTest (delayedInside , delayedOutside );
868+ client .close ();
869+ }
556870}
0 commit comments