Skip to content

Commit dded4a9

Browse files
Fixed test
1 parent c12a942 commit dded4a9

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

compute/cloud-client/src/test/java/compute/Util.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
import com.google.cloud.compute.v1.Reservation;
3030
import com.google.cloud.compute.v1.ReservationsClient;
3131
import com.google.cloud.compute.v1.Snapshot;
32-
import com.google.cloud.compute.v1.SnapshotsClient;
33-
import com.google.cloud.compute.v1.StoragePool;
3432
import compute.deleteprotection.SetDeleteProtection;
35-
import compute.disks.DeleteDisk;
36-
import compute.disks.DeleteSnapshot;
3733
import compute.reservation.DeleteReservation;
3834
import java.io.IOException;
3935
import java.nio.charset.StandardCharsets;

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,19 @@
3131
import java.util.concurrent.TimeUnit;
3232
import java.util.concurrent.TimeoutException;
3333
import org.junit.Assert;
34+
import org.junit.FixMethodOrder;
3435
import org.junit.jupiter.api.AfterAll;
3536
import org.junit.jupiter.api.Assertions;
3637
import org.junit.jupiter.api.BeforeAll;
3738
import org.junit.jupiter.api.Test;
3839
import org.junit.jupiter.api.Timeout;
3940
import org.junit.runner.RunWith;
4041
import org.junit.runners.JUnit4;
41-
42+
import org.junit.runners.MethodSorters;
4243

4344
@RunWith(JUnit4.class)
4445
@Timeout(value = 25, unit = TimeUnit.MINUTES)
46+
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
4547
public class CrudOperationReservationIT {
4648

4749
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
@@ -89,7 +91,7 @@ public static void cleanup()
8991
}
9092

9193
@Test
92-
public void testGetReservation()
94+
public void firstGetReservationTest()
9395
throws IOException {
9496
Reservation reservation = GetReservation.getReservation(
9597
PROJECT_ID, RESERVATION_NAME, ZONE);
@@ -99,7 +101,7 @@ public void testGetReservation()
99101
}
100102

101103
@Test
102-
public void testListReservation() throws IOException {
104+
public void secondListReservationTest() throws IOException {
103105
List<Reservation> reservations =
104106
ListReservations.listReservations(PROJECT_ID, ZONE);
105107

@@ -108,7 +110,7 @@ public void testListReservation() throws IOException {
108110
}
109111

110112
@Test
111-
public void testUpdateVmsForReservation()
113+
public void thirdUpdateVmsForReservationTest()
112114
throws IOException, ExecutionException, InterruptedException, TimeoutException {
113115
TimeUnit.MINUTES.sleep(2);
114116
int newNumberOfVms = 5;

0 commit comments

Comments
 (0)