-
Notifications
You must be signed in to change notification settings - Fork 914
Extension detected by customization flag #3067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"customServiceMetadata": {"contentType" : "application/json"} | ||
"extensionInterface": "software.amazon.awssdk.services.sdkextensions.extensions.SdkExtensionsClientExtensionMethods" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.services.s3.extensions; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; | ||
|
||
import java.io.IOException; | ||
import java.util.Random; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import software.amazon.awssdk.services.s3.S3IntegrationTestBase; | ||
|
||
public class BucketExistsIntegrationTest extends S3IntegrationTestBase { | ||
|
||
private static final String BUCKET = temporaryBucketName(BucketExistsIntegrationTest.class); | ||
|
||
@BeforeClass | ||
public static void setupFixture() throws IOException { | ||
createBucket(BUCKET); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownFixture() { | ||
deleteBucketAndAllContents(BUCKET); | ||
} | ||
|
||
@Test | ||
public void bucketExists() { | ||
assertThat(s3.doesBucketExist(BUCKET)).isTrue(); | ||
} | ||
|
||
@Test | ||
public void bucketDoesNotExist() { | ||
assertThat(s3.doesBucketExist(temporaryBucketName("noexist"))).isFalse(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,5 +159,6 @@ | |
"createMethodParams": [ | ||
"clientConfiguration" | ||
] | ||
} | ||
}, | ||
"extensionInterface": "software.amazon.awssdk.services.s3.extensions.S3ClientExtensionMethods" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we eventually support async extensions as well, do you foresee having 2 fields here? Would it maybe be simpler to just have the package prefix, and we can infer the rest? Or even a simple boolean if we can infer all of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a name is better, at least a package name; leads to less inference. When I added this, I had in mind that we just slap Async on, but that's quite ugly. We could either infer both names or add a more complex structure. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1 users rejoice!
It would be nice to test error conditions here as well. E.g., bucket exists but not owned by you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is primitive for sure!