1717import org .testcontainers .openfga .OpenFGAContainer ;
1818
1919/**
20- * Integration tests for Raw API functionality.
20+ * Integration tests for ApiExecutor functionality.
2121 * These tests demonstrate how to use raw requests to call OpenFGA endpoints
2222 * without using the SDK's typed methods.
2323 */
@@ -41,15 +41,15 @@ public void initializeApi() throws Exception {
4141 }
4242
4343 /**
44- * Test listing stores using raw API instead of fga.listStores().
44+ * Test listing stores using ApiExecutor instead of fga.listStores().
4545 */
4646 @ Test
4747 public void rawRequest_listStores () throws Exception {
4848 // Create a store first so we have something to list
4949 String storeName = "test-store-" + System .currentTimeMillis ();
5050 createStoreUsingRawRequest (storeName );
5151
52- // Use raw API to list stores (equivalent to GET /stores)
52+ // Use ApiExecutor to list stores (equivalent to GET /stores)
5353 ApiExecutorRequestBuilder request =
5454 ApiExecutorRequestBuilder .builder ("GET" , "/stores" ).build ();
5555
@@ -73,7 +73,7 @@ public void rawRequest_listStores() throws Exception {
7373 }
7474
7575 /**
76- * Test creating a store using raw API with typed response.
76+ * Test creating a store using ApiExecutor with typed response.
7777 */
7878 @ Test
7979 public void rawRequest_createStore_typedResponse () throws Exception {
@@ -83,7 +83,7 @@ public void rawRequest_createStore_typedResponse() throws Exception {
8383 Map <String , Object > requestBody = new HashMap <>();
8484 requestBody .put ("name" , storeName );
8585
86- // Use raw API to create store (equivalent to POST /stores)
86+ // Use ApiExecutor to create store (equivalent to POST /stores)
8787 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder ("POST" , "/stores" )
8888 .body (requestBody )
8989 .build ();
@@ -104,7 +104,7 @@ public void rawRequest_createStore_typedResponse() throws Exception {
104104 }
105105
106106 /**
107- * Test creating a store using raw API with raw JSON string response.
107+ * Test creating a store using ApiExecutor with raw JSON string response.
108108 */
109109 @ Test
110110 public void rawRequest_createStore_rawJsonResponse () throws Exception {
@@ -114,7 +114,7 @@ public void rawRequest_createStore_rawJsonResponse() throws Exception {
114114 Map <String , Object > requestBody = new HashMap <>();
115115 requestBody .put ("name" , storeName );
116116
117- // Use raw API to create store and get raw JSON response
117+ // Use ApiExecutor to create store and get raw JSON response
118118 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder ("POST" , "/stores" )
119119 .body (requestBody )
120120 .build ();
@@ -138,15 +138,15 @@ public void rawRequest_createStore_rawJsonResponse() throws Exception {
138138 }
139139
140140 /**
141- * Test getting a specific store using raw API with path parameters.
141+ * Test getting a specific store using ApiExecutor with path parameters.
142142 */
143143 @ Test
144144 public void rawRequest_getStore_withPathParams () throws Exception {
145145 // Create a store first
146146 String storeName = "get-test-store-" + System .currentTimeMillis ();
147147 String storeId = createStoreUsingRawRequest (storeName );
148148
149- // Use raw API to get store details (equivalent to GET /stores/{store_id})
149+ // Use ApiExecutor to get store details (equivalent to GET /stores/{store_id})
150150 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder ("GET" , "/stores/{store_id}" )
151151 .pathParam ("store_id" , storeId )
152152 .build ();
@@ -175,7 +175,7 @@ public void rawRequest_automaticStoreIdReplacement() throws Exception {
175175 String storeId = createStoreUsingRawRequest (storeName );
176176 fga .setStoreId (storeId );
177177
178- // Use raw API WITHOUT providing store_id path param - it should be auto-replaced
178+ // Use ApiExecutor WITHOUT providing store_id path param - it should be auto-replaced
179179 ApiExecutorRequestBuilder request =
180180 ApiExecutorRequestBuilder .builder ("GET" , "/stores/{store_id}" ).build ();
181181
@@ -192,7 +192,7 @@ public void rawRequest_automaticStoreIdReplacement() throws Exception {
192192 }
193193
194194 /**
195- * Test writing authorization model using raw API .
195+ * Test writing authorization model using ApiExecutor .
196196 */
197197 @ Test
198198 public void rawRequest_writeAuthorizationModel () throws Exception {
@@ -226,7 +226,7 @@ public void rawRequest_writeAuthorizationModel() throws Exception {
226226
227227 requestBody .put ("type_definitions" , typeDefinitions );
228228
229- // Use raw API to write authorization model
229+ // Use ApiExecutor to write authorization model
230230 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder (
231231 "POST" , "/stores/{store_id}/authorization-models" )
232232 .body (requestBody )
@@ -259,7 +259,7 @@ public void rawRequest_readAuthorizationModels_withQueryParams() throws Exceptio
259259 // Create an authorization model first
260260 writeSimpleAuthorizationModel (storeId );
261261
262- // Use raw API to read authorization models with query parameters
262+ // Use ApiExecutor to read authorization models with query parameters
263263 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder (
264264 "GET" , "/stores/{store_id}/authorization-models" )
265265 .queryParam ("page_size" , "10" )
@@ -298,7 +298,7 @@ public void rawRequest_check() throws Exception {
298298 // Write a tuple
299299 writeTupleUsingRawRequest (storeId , "user:alice" , "reader" , "document:budget" );
300300
301- // Use raw API to perform check
301+ // Use ApiExecutor to perform check
302302 Map <String , Object > checkBody = new HashMap <>();
303303 checkBody .put ("authorization_model_id" , modelId );
304304
@@ -330,7 +330,7 @@ public void rawRequest_withCustomHeaders() throws Exception {
330330 Map <String , Object > requestBody = new HashMap <>();
331331 requestBody .put ("name" , storeName );
332332
333- // Use raw API with custom headers
333+ // Use ApiExecutor with custom headers
334334 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder ("POST" , "/stores" )
335335 .body (requestBody )
336336 .header ("X-Custom-Header" , "custom-value" )
@@ -382,7 +382,7 @@ public void rawRequest_listStores_withPagination() throws Exception {
382382 createStoreUsingRawRequest ("pagination-test-" + i + "-" + System .currentTimeMillis ());
383383 }
384384
385- // Use raw API to list stores with pagination
385+ // Use ApiExecutor to list stores with pagination
386386 ApiExecutorRequestBuilder request = ApiExecutorRequestBuilder .builder ("GET" , "/stores" )
387387 .queryParam ("page_size" , "2" )
388388 .build ();
0 commit comments