2020import static com .google .common .truth .Truth .assertWithMessage ;
2121import static org .junit .jupiter .api .Assertions .assertNotNull ;
2222
23- import com .google .api .gax .rpc .NotFoundException ;
2423import com .google .cloud .compute .v1 .Reservation ;
2524import compute .Util ;
2625import java .io .ByteArrayOutputStream ;
3433import org .junit .Assert ;
3534import org .junit .FixMethodOrder ;
3635import org .junit .jupiter .api .AfterAll ;
37- import org .junit .jupiter .api .Assertions ;
3836import org .junit .jupiter .api .BeforeAll ;
37+ import org .junit .jupiter .api .Disabled ;
3938import org .junit .jupiter .api .Test ;
4039import org .junit .jupiter .api .Timeout ;
4140import org .junit .runner .RunWith ;
4847public class CrudOperationsReservationIT {
4948
5049 private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
51- private static final String ZONE = "us-west1 -a" ;
50+ private static final String ZONE = "us-central1 -a" ;
5251 private static String RESERVATION_NAME ;
5352 private static final int NUMBER_OF_VMS = 3 ;
5453 static String javaVersion = System .getProperty ("java.version" ).substring (0 , 2 );
@@ -68,21 +67,25 @@ public static void setUp()
6867 + UUID .randomUUID ().toString ().substring (0 , 8 );
6968
7069 // Cleanup existing stale resources.
71- Util .cleanUpExistingReservations ("test-reservation-" + javaVersion , PROJECT_ID , ZONE );
70+ Util .cleanUpExistingReservations ("test-" , PROJECT_ID , ZONE );
71+ Util .cleanUpExistingReservations ("test-" , PROJECT_ID , "us-west1-a" );
72+ Util .cleanUpExistingReservations ("test-" , PROJECT_ID , "asia-south1-a" );
73+
7274 }
7375
7476 @ AfterAll
7577 public static void cleanup ()
7678 throws IOException , ExecutionException , InterruptedException , TimeoutException {
7779 // Delete all reservations created for testing.
78- DeleteReservation .deleteReservation (PROJECT_ID , ZONE , RESERVATION_NAME );
80+ // DeleteReservation.deleteReservation(PROJECT_ID, ZONE, RESERVATION_NAME);
7981
8082 // Test that reservations are deleted
81- Assertions .assertThrows (
82- NotFoundException .class ,
83- () -> GetReservation .getReservation (PROJECT_ID , RESERVATION_NAME , ZONE ));
83+ // Assertions.assertThrows(
84+ // NotFoundException.class,
85+ // () -> GetReservation.getReservation(PROJECT_ID, RESERVATION_NAME, ZONE));
8486 }
8587
88+ @ Disabled
8689 @ Test
8790 public void firstCreateReservationTest ()
8891 throws IOException , ExecutionException , InterruptedException , TimeoutException {
@@ -98,6 +101,7 @@ public void firstCreateReservationTest()
98101 System .setOut (out );
99102 }
100103
104+ @ Disabled
101105 @ Test
102106 public void secondGetReservationTest ()
103107 throws IOException {
@@ -108,6 +112,7 @@ public void secondGetReservationTest()
108112 assertThat (reservation .getName ()).isEqualTo (RESERVATION_NAME );
109113 }
110114
115+ @ Disabled
111116 @ Test
112117 public void thirdListReservationTest () throws IOException {
113118 List <Reservation > reservations =
0 commit comments