Skip to content

Commit

Permalink
fix statObject to use correct objectName (#841)
Browse files Browse the repository at this point in the history
repeated '//' will be dis-allowed on server
  • Loading branch information
harshavardhana authored Feb 6, 2020
1 parent 5592a57 commit b06566e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions functional/FunctionalTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* MinIO Java SDK for Amazon S3 Compatible Cloud Storage,
* (C) 2015-2019 MinIO, Inc.
Expand Down Expand Up @@ -1008,28 +1007,28 @@ public static void statObject_test2() throws Exception {
}

/**
* Test: statObject(String bucketName, "/").
* Test: statObject(String bucketName, "randomName/").
*/
public static void statObject_test3() throws Exception {
if (!mintEnv) {
System.out.println("Test: statObject(String bucketName, \"/\")");
System.out.println("Test: statObject(String bucketName, \"randomName/\")");
}

long startTime = System.currentTimeMillis();
try {
client.statObject(bucketName, "/");
client.statObject(bucketName, getRandomName() + "/");
} catch (ErrorResponseException e) {
if (e.errorResponse().errorCode() != ErrorCode.NO_SUCH_KEY) {
mintFailedLog("statObject(String bucketName, \"/\")", null, startTime, null,
mintFailedLog("statObject(String bucketName, \"randomName/\")", null, startTime, null,
e.toString() + " >>> " + Arrays.toString(e.getStackTrace()));
throw e;
}
} catch (Exception e) {
mintFailedLog("statObject(String bucketName, \"/\")", null, startTime, null,
mintFailedLog("statObject(String bucketName, \"randomName/\")", null, startTime, null,
e.toString() + " >>> " + Arrays.toString(e.getStackTrace()));
throw e;
} finally {
mintSuccessLog("statObject(String bucketName, \"/\"`)", null, startTime);
mintSuccessLog("statObject(String bucketName, \"randomName/\"`)", null, startTime);
}
}

Expand Down

0 comments on commit b06566e

Please sign in to comment.