Skip to content

Commit d43fc7a

Browse files
committed
Convert BeforeClass to BeforeAll
1 parent 98d945a commit d43fc7a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/test/java/org/openapitools/client/api/MediaApiTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.openapitools.client.auth.HttpBasicAuth;
77
import org.openapitools.client.model.Media;
88
import org.openapitools.client.Configuration;
9-
import org.junit.BeforeClass;
9+
import org.junit.jupiter.api.BeforeAll;
1010
import org.junit.jupiter.api.Order;
1111
import org.junit.jupiter.api.Test;
1212
import org.junit.jupiter.api.TestMethodOrder;
@@ -25,24 +25,23 @@
2525

2626
@TestMethodOrder(OrderAnnotation.class)
2727
public class MediaApiTest {
28-
29-
@BeforeClass
30-
public void setupBeforeClass() {
31-
this.uuid = UUID.randomUUID();
32-
}
33-
3428
ApiClient defaultClient = Configuration.getDefaultApiClient();
3529
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
3630
private final MediaApi api = new MediaApi(defaultClient);
3731

3832
private String mediaPath = "src/test/java/org/openapitools/client/fixtures/";
3933
private String mediaFile = "java_cat.jpeg";
40-
private UUID uuid = null;
41-
private String mediaId = JAVA_VERSION + "_" + RUNNER_OS + "_" + this.uuid + "_" + mediaFile;
34+
private static UUID uuid;
35+
private String mediaId = JAVA_VERSION + "_" + RUNNER_OS + "_" + uuid + "_" + mediaFile;
4236
private File media = new File(mediaPath + mediaFile);
4337
private String content_type = "image/jpeg";
4438
private String cache_control = "no-cache";
4539

40+
@BeforeAll
41+
public static void setupBeforeClass() {
42+
uuid = UUID.randomUUID();
43+
}
44+
4645
@Test
4746
@Order(1)
4847
public void uploadMedia() throws ApiException {

0 commit comments

Comments
 (0)