|
47 | 47 | import org.junit.jupiter.api.AfterAll; |
48 | 48 | import org.junit.jupiter.api.Assertions; |
49 | 49 | import org.junit.jupiter.api.BeforeAll; |
50 | | -import org.junit.jupiter.api.MethodOrderer; |
51 | 50 | import org.junit.jupiter.api.Order; |
52 | 51 | import org.junit.jupiter.api.Test; |
53 | | -import org.junit.jupiter.api.TestMethodOrder; |
54 | 52 | import org.junit.jupiter.api.Timeout; |
55 | 53 | import org.junit.runner.RunWith; |
56 | 54 | import org.junit.runners.JUnit4; |
57 | 55 |
|
58 | 56 | @RunWith(JUnit4.class) |
59 | 57 | @Timeout(value = 6, unit = TimeUnit.MINUTES) |
60 | | -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) |
61 | 58 | public class ReservationIT { |
62 | 59 | private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); |
63 | 60 | private static final String ZONE = "asia-south1-a"; |
64 | 61 | private static final String REGION = ZONE.substring(0, ZONE.lastIndexOf('-')); |
65 | | - private static final String RESERVATION_NAME_GLOBAL = |
66 | | - "test-reservation-global-" + UUID.randomUUID(); |
| 62 | + static String templateUUID = UUID.randomUUID().toString(); |
| 63 | + private static final String RESERVATION_NAME_GLOBAL = "test-reservation-global-" + templateUUID; |
67 | 64 | private static final String RESERVATION_NAME_REGIONAL = |
68 | | - "test-reservation-regional-" + UUID.randomUUID(); |
| 65 | + "test-reservation-regional-" + templateUUID; |
69 | 66 | private static final String GLOBAL_INSTANCE_TEMPLATE_NAME = |
70 | | - "test-global-inst-temp-" + UUID.randomUUID(); |
| 67 | + "test-global-inst-temp-" + templateUUID; |
71 | 68 | private static final String REGIONAL_INSTANCE_TEMPLATE_NAME = |
72 | | - "test-regional-inst-temp-" + UUID.randomUUID(); |
| 69 | + "test-regional-inst-temp-" + templateUUID; |
73 | 70 | private static final String GLOBAL_INSTANCE_TEMPLATE_URI = String.format( |
74 | 71 | "projects/%s/global/instanceTemplates/%s", PROJECT_ID, GLOBAL_INSTANCE_TEMPLATE_NAME); |
75 | 72 | private static final String REGIONAL_INSTANCE_TEMPLATE_URI = |
76 | 73 | String.format("projects/%s/regions/%s/instanceTemplates/%s", |
77 | 74 | PROJECT_ID, REGION, REGIONAL_INSTANCE_TEMPLATE_NAME); |
78 | 75 | private static final String SPECIFIC_SHARED_INSTANCE_TEMPLATE_NAME = |
79 | | - "test-shared-inst-temp-" + UUID.randomUUID(); |
| 76 | + "test-shared-inst-temp-" + templateUUID; |
80 | 77 | private static final String INSTANCE_TEMPLATE_SHARED_RESERV_URI = |
81 | 78 | String.format("projects/%s/global/instanceTemplates/%s", |
82 | 79 | PROJECT_ID, SPECIFIC_SHARED_INSTANCE_TEMPLATE_NAME); |
83 | | - private static final String RESERVATION_NAME_SHARED = |
84 | | - "test-reservation-shared-" + UUID.randomUUID(); |
| 80 | + private static final String RESERVATION_NAME_SHARED = "test-reservation-shared-" + templateUUID; |
85 | 81 | private static final int NUMBER_OF_VMS = 3; |
86 | 82 | private static ByteArrayOutputStream stdOut; |
87 | 83 |
|
@@ -155,7 +151,6 @@ public static void cleanup() |
155 | 151 | } |
156 | 152 |
|
157 | 153 | @Test |
158 | | - @Order(1) |
159 | 154 | public void testCreateReservationWithGlobalInstanceTemplate() |
160 | 155 | throws IOException, ExecutionException, InterruptedException, TimeoutException { |
161 | 156 | Reservation reservation = CreateReservationForInstanceTemplate |
|
0 commit comments