File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
main/java/software/amazon/awssdk/services/s3/internal/crt
test/java/software/amazon/awssdk/services/s3/internal/crt Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 121
121
<rxjava .version>2.2.21</rxjava .version>
122
122
<commons-codec .verion>1.15</commons-codec .verion>
123
123
<jmh .version>1.37</jmh .version>
124
- <awscrt .version>0.29.23 </awscrt .version>
124
+ <awscrt .version>0.29.25 </awscrt .version>
125
125
126
126
<!-- Test dependencies -->
127
127
<junit5 .version>5.10.0</junit5 .version>
Original file line number Diff line number Diff line change @@ -137,7 +137,8 @@ public CompletableFuture<Void> execute(AsyncExecuteRequest asyncRequest) {
137
137
httpExecutionAttributes .getAttribute (CRT_PROGRESS_LISTENER ),
138
138
s3MetaRequestFuture );
139
139
140
- S3MetaRequestOptions .MetaRequestType requestType = requestType (asyncRequest );
140
+ String operationName = asyncRequest .httpExecutionAttributes ().getAttribute (OPERATION_NAME );
141
+ S3MetaRequestOptions .MetaRequestType requestType = requestType (operationName );
141
142
142
143
HttpChecksum httpChecksum = httpExecutionAttributes .getAttribute (HTTP_CHECKSUM );
143
144
ResumeToken resumeToken = httpExecutionAttributes .getAttribute (CRT_PAUSE_RESUME_TOKEN );
@@ -156,6 +157,7 @@ public CompletableFuture<Void> execute(AsyncExecuteRequest asyncRequest) {
156
157
.withEndpoint (endpoint )
157
158
.withResponseHandler (responseHandler )
158
159
.withResumeToken (resumeToken )
160
+ .withOperationName (operationName )
159
161
.withRequestFilePath (requestFilePath )
160
162
.withSigningConfig (signingConfig );
161
163
@@ -202,8 +204,7 @@ public String clientName() {
202
204
return "s3crt" ;
203
205
}
204
206
205
- private static S3MetaRequestOptions .MetaRequestType requestType (AsyncExecuteRequest asyncRequest ) {
206
- String operationName = asyncRequest .httpExecutionAttributes ().getAttribute (OPERATION_NAME );
207
+ private static S3MetaRequestOptions .MetaRequestType requestType (String operationName ) {
207
208
if (operationName != null ) {
208
209
switch (operationName ) {
209
210
case "GetObject" :
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ public void getObject_shouldSetMetaRequestTypeCorrectly() {
131
131
132
132
S3MetaRequestOptions actual = makeRequest (asyncExecuteRequest );
133
133
assertThat (actual .getMetaRequestType ()).isEqualTo (S3MetaRequestOptions .MetaRequestType .GET_OBJECT );
134
+ assertThat (actual .getOperationName ()).isEqualTo ("GetObject" );
134
135
}
135
136
136
137
@ Test
@@ -140,8 +141,20 @@ public void putObject_shouldSetMetaRequestTypeCorrectly() {
140
141
141
142
S3MetaRequestOptions actual = makeRequest (asyncExecuteRequest );
142
143
assertThat (actual .getMetaRequestType ()).isEqualTo (S3MetaRequestOptions .MetaRequestType .PUT_OBJECT );
144
+ assertThat (actual .getOperationName ()).isEqualTo ("PutObject" );
143
145
}
144
146
147
+ @ Test
148
+ public void NonStreamingOperation_shouldSetMetaRequestTypeCorrectly () {
149
+ AsyncExecuteRequest asyncExecuteRequest = getExecuteRequestBuilder ().putHttpExecutionAttribute (OPERATION_NAME ,
150
+ "CreateBucket" ).build ();
151
+
152
+ S3MetaRequestOptions actual = makeRequest (asyncExecuteRequest );
153
+ assertThat (actual .getMetaRequestType ()).isEqualTo (S3MetaRequestOptions .MetaRequestType .DEFAULT );
154
+ assertThat (actual .getOperationName ()).isEqualTo ("CreateBucket" );
155
+ }
156
+
157
+
145
158
@ Test
146
159
public void cancelRequest_shouldForwardCancellation () {
147
160
AsyncExecuteRequest asyncExecuteRequest = getExecuteRequestBuilder ().build ();
You can’t perform that action at this time.
0 commit comments