88import io .github .cdimascio .dotenv .Dotenv ;
99import okhttp3 .ResponseBody ;
1010import org .json .simple .JSONObject ;
11- import org .junit .Ignore ;
1211import org .junit .jupiter .api .*;
1312import retrofit2 .Response ;
1413
1514import java .io .IOException ;
1615import java .util .HashMap ;
17- import java .util .Map ;
1816import java .util .logging .Logger ;
1917
2018@ Tag ("api" )
@@ -84,10 +82,7 @@ void testFetchAPI() throws IOException {
8482 @ Test
8583 @ Order (3 )
8684 void testSingleApi () throws IOException {
87- Map <String , Object > mapQuery = new HashMap <>();
88- mapQuery .put ("version" , 1 );
89- mapQuery .put ("include_global_field_schema" , true );
90- Response <ResponseBody > response = contentType .single (contentTypeUid ).execute ();
85+ Response <ResponseBody > response = contentType .single ().execute ();
9186 if (response .isSuccessful ()) {
9287 JsonObject jsonObject = Utils .toJson (response );
9388 Assertions .assertTrue (jsonObject .has ("content_type" ));
@@ -101,7 +96,7 @@ void testSingleApi() throws IOException {
10196 @ Test
10297 void testUpdate () throws IOException {
10398 JSONObject requestBody = Utils .readJson ("mockcontenttype/update.json" );
104- Response <ResponseBody > response = contentType .update ("fake_content_type" , requestBody ).execute ();
99+ Response <ResponseBody > response = contentType .update ( requestBody ).execute ();
105100 if (response .isSuccessful ()) {
106101 JsonObject jsonObject = Utils .toJson (response );
107102 Assertions .assertTrue (jsonObject .has ("notice" ));
@@ -114,7 +109,7 @@ void testUpdate() throws IOException {
114109 void testFieldVisibilityRule () throws IOException {
115110 JSONObject requestBody = Utils .readJson ("mockcontenttype/visibility.json" );
116111 Response <ResponseBody > response = contentType .fieldVisibilityRule (
117- "fake_content_type" , requestBody ).execute ();
112+ requestBody ).execute ();
118113 Assertions .assertFalse (response .isSuccessful ());
119114
120115 }
@@ -123,7 +118,7 @@ void testFieldVisibilityRule() throws IOException {
123118 @ Test
124119 @ Disabled ("No need to import all time" )
125120 void testReference () throws IOException {
126- Response <ResponseBody > response = contentType .reference (contentTypeUid , false ).execute ();
121+ Response <ResponseBody > response = contentType .reference ( false ).execute ();
127122 if (response .isSuccessful ()) {
128123 JsonObject jsonObject = Utils .toJson (response );
129124 Assertions .assertTrue (jsonObject .has ("references" ));
@@ -136,23 +131,23 @@ void testReference() throws IOException {
136131 @ Order (7 )
137132 @ Test
138133 void testReferenceIncludingGlobalField () throws IOException {
139- Response <ResponseBody > response = contentType .referenceIncludeGlobalField (contentTypeUid ).execute ();
134+ Response <ResponseBody > response = contentType .referenceIncludeGlobalField ().execute ();
140135 assert response .body () != null ;
141136 Assertions .assertTrue (response .isSuccessful ());
142137 }
143138
144139 @ Order (8 )
145140 @ Test
146141 void testExport () throws IOException {
147- Response <ResponseBody > response = contentType .export (contentTypeUid ).execute ();
142+ Response <ResponseBody > response = contentType .export ().execute ();
148143 assert response .body () != null ;
149144 Assertions .assertTrue (response .isSuccessful ());
150145 }
151146
152147 @ Order (9 )
153148 @ Test
154149 void testExportByVersion () throws IOException {
155- Response <ResponseBody > response = contentType .export (contentTypeUid , 1 ).execute ();
150+ Response <ResponseBody > response = contentType .export ( 1 ).execute ();
156151 if (response .isSuccessful ()) {
157152 JsonObject jsonObject = Utils .toJson (response );
158153 Assertions .assertTrue (jsonObject .has ("schema" ));
@@ -193,17 +188,17 @@ void testImportOverwrite() throws IOException {
193188
194189 @ Order (12 )
195190 @ Test
196- @ Ignore
197- void testDelete () throws IOException {
198- Response <ResponseBody > response = contentType .delete ("fake_content_type" ).execute ();
191+ @ Disabled ( "avoid running delete forcefully" )
192+ void testDeleteContentType () throws IOException {
193+ Response <ResponseBody > response = contentType .delete ().execute ();
199194 Assertions .assertTrue (response .isSuccessful ());
200195 }
201196
202197 @ Order (13 )
203198 @ Disabled ("avoid running delete forcefully" )
204199 @ Test
205200 void testDeleteForcefully () throws IOException {
206- Response <ResponseBody > response = contentType .delete (contentTypeUid ).execute ();
201+ Response <ResponseBody > response = contentType .delete ().execute ();
207202 assert response .body () != null ;
208203 if (response .isSuccessful ()) {
209204 JsonObject jsonObject = Utils .toJson (response );
0 commit comments