Skip to content

Commit ad6d39c

Browse files
Moved updateVm test to ReservationIT
1 parent e5a38c2 commit ad6d39c

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

compute/cloud-client/src/test/java/compute/reservation/CrudOperationsReservationIT.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,4 @@ public void testListReservation() throws IOException {
120120
assertThat(reservations).isNotNull();
121121
Assert.assertTrue(reservations.get(0).getName().contains("test-"));
122122
}
123-
124-
@Test
125-
@Order(2)
126-
public void testUpdateVmsForReservation()
127-
throws IOException, ExecutionException, InterruptedException, TimeoutException {
128-
int newNumberOfVms = 5;
129-
UpdateVmsForReservation.updateVmsForReservation(
130-
PROJECT_ID, ZONE, RESERVATION_NAME, newNumberOfVms);
131-
Reservation reservation = GetReservation.getReservation(
132-
PROJECT_ID, RESERVATION_NAME, ZONE);
133-
134-
Assert.assertEquals(newNumberOfVms, reservation.getSpecificReservation().getCount());
135-
}
136123
}

compute/cloud-client/src/test/java/compute/reservation/ReservationIT.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@
3838
import org.junit.jupiter.api.AfterAll;
3939
import org.junit.jupiter.api.Assertions;
4040
import org.junit.jupiter.api.BeforeAll;
41+
import org.junit.jupiter.api.MethodOrderer;
42+
import org.junit.jupiter.api.Order;
4143
import org.junit.jupiter.api.Test;
44+
import org.junit.jupiter.api.TestMethodOrder;
4245
import org.junit.jupiter.api.Timeout;
4346
import org.junit.runner.RunWith;
4447
import org.junit.runners.JUnit4;
4548

4649
@RunWith(JUnit4.class)
4750
@Timeout(value = 25, unit = TimeUnit.MINUTES)
51+
@TestMethodOrder(MethodOrderer. OrderAnnotation. class)
4852
public 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

Comments
 (0)