Skip to content

Commit 703179f

Browse files
Merged changes from main
1 parent 6f6a554 commit 703179f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,20 @@
3232
import java.util.concurrent.TimeUnit;
3333
import java.util.concurrent.TimeoutException;
3434
import org.junit.Assert;
35-
import org.junit.FixMethodOrder;
3635
import org.junit.jupiter.api.AfterAll;
3736
import org.junit.jupiter.api.Assertions;
3837
import org.junit.jupiter.api.BeforeAll;
38+
import org.junit.jupiter.api.MethodOrderer;
39+
import org.junit.jupiter.api.Order;
3940
import org.junit.jupiter.api.Test;
41+
import org.junit.jupiter.api.TestMethodOrder;
4042
import org.junit.jupiter.api.Timeout;
4143
import org.junit.runner.RunWith;
4244
import org.junit.runners.JUnit4;
43-
import org.junit.runners.MethodSorters;
4445

4546
@RunWith(JUnit4.class)
4647
@Timeout(value = 25, unit = TimeUnit.MINUTES)
47-
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
48+
@TestMethodOrder(MethodOrderer. OrderAnnotation. class)
4849
public class CrudOperationsReservationIT {
4950

5051
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
@@ -84,7 +85,8 @@ public static void cleanup()
8485
}
8586

8687
@Test
87-
public void firstCreateReservationTest()
88+
@Order(1)
89+
public void testCreateReservation()
8890
throws IOException, ExecutionException, InterruptedException, TimeoutException {
8991
final PrintStream out = System.out;
9092
ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
@@ -99,7 +101,8 @@ public void firstCreateReservationTest()
99101
}
100102

101103
@Test
102-
public void secondGetReservationTest()
104+
@Order(2)
105+
public void testGetReservation()
103106
throws IOException {
104107
Reservation reservation = GetReservation.getReservation(
105108
PROJECT_ID, RESERVATION_NAME, ZONE);
@@ -109,7 +112,8 @@ public void secondGetReservationTest()
109112
}
110113

111114
@Test
112-
public void thirdListReservationTest() throws IOException {
115+
@Order(3)
116+
public void testListReservation() throws IOException {
113117
List<Reservation> reservations =
114118
ListReservations.listReservations(PROJECT_ID, ZONE);
115119

@@ -118,6 +122,7 @@ public void thirdListReservationTest() throws IOException {
118122
}
119123

120124
@Test
125+
@Order(3)
121126
public void testUpdateVmsForReservation()
122127
throws IOException, ExecutionException, InterruptedException, TimeoutException {
123128
int newNumberOfVms = 5;

0 commit comments

Comments
 (0)