peterxcli commented on code in PR #8379:
URL: https://github.com/apache/ozone/pull/8379#discussion_r2072341281
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketList.java:
##########
@@ -525,14 +452,12 @@ private void assertEncodingTypeObject(
assertEquals(exceptEncodingType, object.getEncodingType());
}
- private OzoneClient createClientWithKeys(String... keys) throws IOException {
- OzoneClient client = new OzoneClientStub();
-
- client.getObjectStore().createS3Bucket("b1");
- OzoneBucket bucket = client.getObjectStore().getS3Bucket("b1");
+ private void createClientWithKeys(String... keys) throws IOException {
Review Comment:
or
```suggestion
private void createKeys(Client client, String... keys) throws IOException {
```
and the setup:
```
setup (keys) {
client = new client;
createKeys(client, keys);
}
```
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketList.java:
##########
@@ -43,17 +44,22 @@
*/
public class TestBucketList {
- @Test
- public void listRoot() throws OS3Exception, IOException {
+ private static final String BUCKET_NAME = OzoneConsts.BUCKET;
Review Comment:
Or maybe `String BUCKET_NAME = "b1"`?
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestBucketList.java:
##########
@@ -525,14 +452,12 @@ private void assertEncodingTypeObject(
assertEquals(exceptEncodingType, object.getEncodingType());
}
- private OzoneClient createClientWithKeys(String... keys) throws IOException {
- OzoneClient client = new OzoneClientStub();
-
- client.getObjectStore().createS3Bucket("b1");
- OzoneBucket bucket = client.getObjectStore().getS3Bucket("b1");
+ private void createClientWithKeys(String... keys) throws IOException {
Review Comment:
I would prefer to keep the return here, then assign the returned client to
the `this.client` in setup.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]