dimas-b commented on code in PR #590:
URL: https://github.com/apache/polaris/pull/590#discussion_r1907945014


##########
integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java:
##########
@@ -715,36 +622,22 @@ public void testRequestBodyTooLarge() {
     // The size is set to be higher than the limit in 
polaris-server-integrationtest.yml
     Entity<PrincipalRole> largeRequest = Entity.json(new 
PrincipalRole("r".repeat(1000001)));
 
-    try (Response response =
-        EXT.client()
-            .target(
-                String.format(
-                    "http://localhost:%d/api/management/v1/principal-roles";, 
EXT.getLocalPort()))
-            .request("application/json")
-            .header("Authorization", "Bearer " + userToken)
-            .header(REALM_PROPERTY_KEY, realm)
-            .post(largeRequest)) {
+    try (Response response = 
managementApi.request("v1/principal-roles").post(largeRequest)) {
       assertThat(response)
           .returns(Response.Status.BAD_REQUEST.getStatusCode(), 
Response::getStatus)
-          .matches(
-              r ->
-                  r.readEntity(RequestThrottlingErrorResponse.class)
-                      .errorType()
-                      .equals(REQUEST_TOO_LARGE));
+          .extracting(r -> r.readEntity(Map.class))
+          .extracting("error_type")
+          .isEqualTo("REQUEST_TOO_LARGE");
     }
   }
 
   @Test
   public void testRefreshToken() throws IOException {
-    String path =
-        String.format("http://localhost:%d/api/catalog/v1/oauth/tokens";, 
EXT.getLocalPort());
+    String path = 
endpoints.catalogApiEndpoint().resolve("v1/oauth/tokens").toString();
     try (RESTClient client =
-        HTTPClient.builder(ImmutableMap.of())
-            .withHeader(REALM_PROPERTY_KEY, realm)
-            .uri(path)
-            .build()) {
+        HTTPClient.builder(Map.of()).withHeader(REALM_HEADER, 
realm).uri(path).build()) {
       String credentialString =
-          snowmanCredentials.clientId() + ":" + 
snowmanCredentials.clientSecret();
+          clientCredentials.clientId() + ":" + 
clientCredentials.clientSecret();
       var authConfig =
           
AuthConfig.builder().credential(credentialString).scope("PRINCIPAL_ROLE:ALL").build();
       ImmutableAuthConfig configSpy = spy(authConfig);

Review Comment:
   #629 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to