Search in sources :

Example 6 with WriteGetObjectResponseRequest

use of com.amazonaws.services.s3.model.WriteGetObjectResponseRequest in project aws-sdk-java-v2 by aws.

the class S3ObjectLambdaOperationEndpointResolverTest method writeGetObjectResponse_regionIsAwsGlobal_shouldConvertEndpoint.

@Test
// TODO: Taken from the SEP but this test case is suspect. The SEP
@Disabled
public // the resulting endpoint is s3-object-lambda.amazonaws.com
void writeGetObjectResponse_regionIsAwsGlobal_shouldConvertEndpoint() {
    String requestRoute = "route";
    String region = "aws-global";
    String expectedHost = "route.s3-object-lambda.us-east-1.amazonaws.com";
    WriteGetObjectResponseRequest request = WriteGetObjectResponseRequest.builder().requestRoute(requestRoute).build();
    verifyObjectLambdaEndpoint("https", request, region, null, URI.create("https://" + expectedHost), S3Configuration.builder());
    verifyObjectLambdaEndpoint("http", request, region, null, URI.create("http://" + expectedHost), S3Configuration.builder());
}
Also used : WriteGetObjectResponseRequest(software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 7 with WriteGetObjectResponseRequest

use of com.amazonaws.services.s3.model.WriteGetObjectResponseRequest in project aws-sdk-java-v2 by aws.

the class S3ObjectLambdaOperationEndpointResolverTest method writeGetObjectResponse_nonStandardPartitionRegion_shouldConvertEndpointWithCorrectDnsSuffix.

@Test
public void writeGetObjectResponse_nonStandardPartitionRegion_shouldConvertEndpointWithCorrectDnsSuffix() {
    String requestRoute = "route";
    String region = "cn-north-1";
    String expectedHost = "route.s3-object-lambda.cn-north-1.amazonaws.com.cn";
    WriteGetObjectResponseRequest request = WriteGetObjectResponseRequest.builder().requestRoute(requestRoute).build();
    verifyObjectLambdaEndpoint("https", request, region, null, URI.create("https://" + expectedHost), S3Configuration.builder());
    verifyObjectLambdaEndpoint("http", request, region, null, URI.create("http://" + expectedHost), S3Configuration.builder());
}
Also used : WriteGetObjectResponseRequest(software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest) Test(org.junit.jupiter.api.Test)

Example 8 with WriteGetObjectResponseRequest

use of com.amazonaws.services.s3.model.WriteGetObjectResponseRequest in project aws-sdk-java-v2 by aws.

the class S3ObjectLambdaOperationEndpointResolverTest method writeGetObjectResponse_regionIsFipsInPrefix_shouldConvertEndpoint.

@Test
// SDK doesn't resolve fips endpoints correctly
@Disabled
public void writeGetObjectResponse_regionIsFipsInPrefix_shouldConvertEndpoint() {
    String requestRoute = "route";
    String region = "fips-us-gov-east-1";
    String expectedHost = "route.s3-object-lambda-fips.us-gov-east-1.amazonaws.com";
    WriteGetObjectResponseRequest request = WriteGetObjectResponseRequest.builder().requestRoute(requestRoute).build();
    verifyObjectLambdaEndpoint("https", request, region, null, URI.create("https://" + expectedHost), S3Configuration.builder());
    verifyObjectLambdaEndpoint("http", request, region, null, URI.create("http://" + expectedHost), S3Configuration.builder());
}
Also used : WriteGetObjectResponseRequest(software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 9 with WriteGetObjectResponseRequest

use of com.amazonaws.services.s3.model.WriteGetObjectResponseRequest in project aws-sdk-java-v2 by aws.

the class S3ObjectLambdaOperationEndpointResolverTest method writeGetObjectResponse_endpointOverridden_shouldConvertEndpoint.

@Test
public void writeGetObjectResponse_endpointOverridden_shouldConvertEndpoint() {
    String requestRoute = "route";
    String region = "us-west-2";
    String endpointOverride = "my-endpoint.com";
    String expectedHost = "route.my-endpoint.com";
    WriteGetObjectResponseRequest request = WriteGetObjectResponseRequest.builder().requestRoute(requestRoute).build();
    verifyObjectLambdaEndpoint("https", request, region, URI.create("https://" + endpointOverride), URI.create("https://" + expectedHost), S3Configuration.builder());
    verifyObjectLambdaEndpoint("http", request, region, URI.create("http://" + endpointOverride), URI.create("http://" + expectedHost), S3Configuration.builder());
}
Also used : WriteGetObjectResponseRequest(software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest) Test(org.junit.jupiter.api.Test)

Example 10 with WriteGetObjectResponseRequest

use of com.amazonaws.services.s3.model.WriteGetObjectResponseRequest in project aws-sdk-java-v2 by aws.

the class S3ObjectLambdaOperationEndpointResolverTest method writeGetObjectResponse_shouldConvertEndpoint.

@Test
public void writeGetObjectResponse_shouldConvertEndpoint() {
    String requestRoute = "route";
    String region = "us-west-2";
    String expectedHost = "route.s3-object-lambda.us-west-2.amazonaws.com";
    WriteGetObjectResponseRequest request = WriteGetObjectResponseRequest.builder().requestRoute(requestRoute).build();
    verifyObjectLambdaEndpoint("https", request, region, null, URI.create("https://" + expectedHost), S3Configuration.builder());
    verifyObjectLambdaEndpoint("http", request, region, null, URI.create("http://" + expectedHost), S3Configuration.builder());
}
Also used : WriteGetObjectResponseRequest(software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest) Test(org.junit.jupiter.api.Test)

Aggregations

WriteGetObjectResponseRequest (software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest)8 Test (org.junit.jupiter.api.Test)7 Disabled (org.junit.jupiter.api.Disabled)4 WriteGetObjectResponseRequest (com.amazonaws.services.s3.model.WriteGetObjectResponseRequest)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 SAXException (org.xml.sax.SAXException)2 ObjectMetadata (com.amazonaws.services.s3.model.ObjectMetadata)1 Checksum (com.example.s3objectlambda.checksum.Checksum)1 S3RequestError (com.example.s3objectlambda.error.S3RequestError)1 XMLErrorParser (com.example.s3objectlambda.error.XMLErrorParser)1 URI (java.net.URI)1 HashMap (java.util.HashMap)1 SdkHttpRequest (software.amazon.awssdk.http.SdkHttpRequest)1 ConfiguredS3SdkHttpRequest (software.amazon.awssdk.services.s3.internal.ConfiguredS3SdkHttpRequest)1