Skip to content

Commit 5c6afec

Browse files
committed
Verify response from Polaris catalog
1 parent 2a0ff84 commit 5c6afec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/rest/TestingPolarisCatalog.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ private void grantPrivilege()
124124
.setHeader("Content-Type", "application/json")
125125
.setBodyGenerator(createStaticBodyGenerator(body, UTF_8))
126126
.build();
127-
HTTP_CLIENT.execute(request, createStatusResponseHandler());
127+
StatusResponseHandler.StatusResponse response = HTTP_CLIENT.execute(request, createStatusResponseHandler());
128+
checkState(response.getStatusCode() == 201, "Failed to grant privilege, status code: %s", response.getStatusCode());
128129
}
129130

130131
public void dropTable(String schema, String table)
@@ -134,7 +135,8 @@ public void dropTable(String schema, String table)
134135
.setHeader("Authorization", "Bearer " + token)
135136
.setHeader("Content-Type", "application/json")
136137
.build();
137-
HTTP_CLIENT.execute(request, createStatusResponseHandler());
138+
StatusResponseHandler.StatusResponse response = HTTP_CLIENT.execute(request, createStatusResponseHandler());
139+
checkState(response.getStatusCode() == 204, "Failed to drop table, status code: %s", response.getStatusCode());
138140
}
139141

140142
public String restUri()

0 commit comments

Comments
 (0)