Skip to content

fix: skip functional tests on HTTP 405/501 responses#1694

Open
harshavardhana wants to merge 1 commit intomasterfrom
skip-tests-on-405-501
Open

fix: skip functional tests on HTTP 405/501 responses#1694
harshavardhana wants to merge 1 commit intomasterfrom
skip-tests-on-405-501

Conversation

@harshavardhana
Copy link
Copy Markdown
Member

Use HTTP status codes directly instead of checking error
code strings, so tests are properly skipped when APIs
return 405 (Method Not Allowed) or 501 (Not Implemented).

Use HTTP status codes directly instead of checking error
code strings, so tests are properly skipped when APIs
return 405 (Method Not Allowed) or 501 (Not Implemented).
Comment on lines +433 to +434
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinioClient already returns MethodNotAllowed S3 error code for 405 and 501 HTTP status code.

Suggested change
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented") || (ErrorResponseException) e).errorResponse().code().equals("MethodNotAllowed")) {

Comment on lines +713 to +714
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MinioClient already returns MethodNotAllowed S3 error code for 405 and 501 HTTP status code.

Suggested change
int code = ((ErrorResponseException) e).response().code();
if (code == 405 || code == 501) {
if (((ErrorResponseException) e).errorResponse().code().equals("NotImplemented") || (ErrorResponseException) e).errorResponse().code().equals("MethodNotAllowed")) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants