@@ -29,11 +29,11 @@ public class MediaApiTest {
2929 HttpBasicAuth Basic = (HttpBasicAuth ) defaultClient .getAuthentication ("Basic" );
3030 private final MediaApi api = new MediaApi (defaultClient );
3131
32- private String mediaPath = "src/test/java/org/openapitools/client/fixtures/" ;
33- private String mediaFile = "java_cat.jpeg" ;
32+ private static String mediaPath = "src/test/java/org/openapitools/client/fixtures/" ;
33+ private static String mediaFile = "java_cat.jpeg" ;
3434 private static UUID uuid ;
35- private String mediaId = JAVA_VERSION + "_" + RUNNER_OS + "_" + uuid + "_" + mediaFile ;
36- private File media = new File (mediaPath + mediaFile );
35+ private static String mediaId = JAVA_VERSION + "_" + RUNNER_OS + "_" + uuid + "_" + mediaFile ;
36+ private static File media = new File (mediaPath + mediaFile );
3737 private String contentType = "image/jpeg" ;
3838 private String cacheControl = "no-cache" ;
3939
@@ -48,12 +48,11 @@ public void uploadMedia() throws ApiException {
4848 Basic .setUsername (BW_USERNAME );
4949 Basic .setPassword (BW_PASSWORD );
5050
51- ApiResponse <Void > response = api .uploadMediaWithHttpInfo (BW_ACCOUNT_ID , this . mediaId , this . media ,
51+ ApiResponse <Void > response = api .uploadMediaWithHttpInfo (BW_ACCOUNT_ID , mediaId , media ,
5252 this .contentType ,
5353 this .cacheControl );
5454
5555 assertThat (response .getStatusCode (), is (204 ));
56- System .out .println (this .mediaId );
5756 }
5857
5958 @ Test
@@ -64,21 +63,18 @@ public void listMedia() throws ApiException {
6463 ApiResponse <List <Media >> response = api .listMediaWithHttpInfo (BW_ACCOUNT_ID , null );
6564
6665 assertThat (response .getStatusCode (), is (200 ));
67- System .out .println (this .mediaId );
68-
6966 }
7067
7168 @ Test
7269 @ Order (3 )
7370 public void getMedia () throws ApiException , IOException {
7471 Basic .setUsername (BW_USERNAME );
7572 Basic .setPassword (BW_PASSWORD );
76- System .out .println (this .mediaId );
7773
78- ApiResponse <File > response = api .getMediaWithHttpInfo (BW_ACCOUNT_ID , this . mediaId );
74+ ApiResponse <File > response = api .getMediaWithHttpInfo (BW_ACCOUNT_ID , mediaId );
7975
8076 assertThat (response .getStatusCode (), is (200 ));
81- assertThat (FileUtils .readLines (response .getData (), "utf-8" ), is (FileUtils .readLines (this . media , "utf-8" )));
77+ assertThat (FileUtils .readLines (response .getData (), "utf-8" ), is (FileUtils .readLines (media , "utf-8" )));
8278 }
8379
8480 @ Test
@@ -87,7 +83,7 @@ public void deleteMedia() throws ApiException {
8783 Basic .setUsername (BW_USERNAME );
8884 Basic .setPassword (BW_PASSWORD );
8985
90- ApiResponse <Void > response = api .deleteMediaWithHttpInfo (BW_ACCOUNT_ID , this . mediaId );
86+ ApiResponse <Void > response = api .deleteMediaWithHttpInfo (BW_ACCOUNT_ID , mediaId );
9187 assertThat (response .getStatusCode (), is (204 ));
9288 }
9389}
0 commit comments