3838import org .junit .jupiter .api .AfterAll ;
3939import org .junit .jupiter .api .Assertions ;
4040import org .junit .jupiter .api .BeforeAll ;
41+ import org .junit .jupiter .api .MethodOrderer ;
42+ import org .junit .jupiter .api .Order ;
4143import org .junit .jupiter .api .Test ;
44+ import org .junit .jupiter .api .TestMethodOrder ;
4245import org .junit .jupiter .api .Timeout ;
4346import org .junit .runner .RunWith ;
4447import org .junit .runners .JUnit4 ;
4548
4649@ RunWith (JUnit4 .class )
4750@ Timeout (value = 25 , unit = TimeUnit .MINUTES )
51+ @ TestMethodOrder (MethodOrderer . OrderAnnotation . class )
4852public class ReservationIT {
4953
5054 private static final String PROJECT_ID = System .getenv ("GOOGLE_CLOUD_PROJECT" );
@@ -152,6 +156,7 @@ public static void cleanup()
152156 }
153157
154158 @ Test
159+ @ Order (1 )
155160 public void testCreateReservationWithGlobalInstanceTemplate ()
156161 throws IOException , ExecutionException , InterruptedException , TimeoutException {
157162 CreateReservationForInstanceTemplate .createReservationForInstanceTemplate (
@@ -177,4 +182,17 @@ public void testCreateReservationWithRegionInstanceTemplate()
177182 Assert .assertTrue (reservation .getZone ().contains (ZONE ));
178183 Assert .assertEquals (RESERVATION_NAME_REGIONAL , reservation .getName ());
179184 }
185+
186+ @ Test
187+ @ Order (2 )
188+ public void testUpdateVmsForReservation ()
189+ throws IOException , ExecutionException , InterruptedException , TimeoutException {
190+ int newNumberOfVms = 5 ;
191+ UpdateVmsForReservation .updateVmsForReservation (
192+ PROJECT_ID , ZONE , RESERVATION_NAME_GLOBAL , newNumberOfVms );
193+ Reservation reservation = GetReservation .getReservation (
194+ PROJECT_ID , RESERVATION_NAME_GLOBAL , ZONE );
195+
196+ Assert .assertEquals (newNumberOfVms , reservation .getSpecificReservation ().getCount ());
197+ }
180198}
0 commit comments