16
16
import com .google .inject .Inject ;
17
17
import io .airlift .http .server .testing .TestingHttpServer ;
18
18
import io .trino .s3 .proxy .server .credentials .Credentials ;
19
- import io .trino .s3 .proxy .server .rest .TrinoS3ProxyRestConstants ;
19
+ import io .trino .s3 .proxy .server .rest .TrinoS3ProxyConfig ;
20
20
import io .trino .s3 .proxy .server .testing .ManagedS3MockContainer .ForS3MockContainer ;
21
21
import io .trino .s3 .proxy .server .testing .TestingCredentialsRolesProvider ;
22
22
import io .trino .s3 .proxy .server .testing .TestingUtil .ForTesting ;
@@ -51,9 +51,10 @@ public TestProxiedAssumedRoleRequests(
51
51
@ ForTesting Credentials testingCredentials ,
52
52
TestingCredentialsRolesProvider credentialsController ,
53
53
@ ForS3MockContainer S3Client storageClient ,
54
- @ ForS3MockContainer List <String > configuredBuckets )
54
+ @ ForS3MockContainer List <String > configuredBuckets ,
55
+ TrinoS3ProxyConfig trinoS3ProxyConfig )
55
56
{
56
- this (buildClient (httpServer , testingCredentials ), testingCredentials , credentialsController , storageClient , configuredBuckets );
57
+ this (buildClient (httpServer , testingCredentials , trinoS3ProxyConfig . getS3Prefix (), trinoS3ProxyConfig . getStsPrefix () ), testingCredentials , credentialsController , storageClient , configuredBuckets );
57
58
}
58
59
59
60
protected TestProxiedAssumedRoleRequests (
@@ -75,11 +76,11 @@ public void validateCount()
75
76
credentialsController .resetAssumedRoles ();
76
77
}
77
78
78
- protected static S3Client buildClient (TestingHttpServer httpServer , Credentials credentials )
79
+ protected static S3Client buildClient (TestingHttpServer httpServer , Credentials credentials , String s3Prefix , String stsPrefix )
79
80
{
80
81
URI baseUrl = httpServer .getBaseUrl ();
81
- URI localProxyServerUri = baseUrl .resolve (TrinoS3ProxyRestConstants . S3_PATH );
82
- URI localStsServerUri = baseUrl .resolve (TrinoS3ProxyRestConstants . STS_PATH );
82
+ URI localProxyServerUri = baseUrl .resolve (s3Prefix );
83
+ URI localStsServerUri = baseUrl .resolve (stsPrefix );
83
84
84
85
AwsBasicCredentials awsBasicCredentials = AwsBasicCredentials .create (credentials .emulated ().accessKey (), credentials .emulated ().secretKey ());
85
86
0 commit comments