Skip to content

Commit 576252a

Browse files
committed
Fixing gzip test
1 parent c9841b1 commit 576252a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/sdk-core/src/main/java/software/amazon/awssdk/core/useragent/BusinessMetricFeatureId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public enum BusinessMetricFeatureId {
3434
RETRY_MODE_STANDARD("E"),
3535
RETRY_MODE_ADAPTIVE("F"),
3636
S3_TRANSFER("G"),
37-
GZIP_REQUEST_COMPRESSION("L"), //TODO(metrics): Not working, compression happens after header
37+
GZIP_REQUEST_COMPRESSION("L"),
3838
PROTOCOL_RPC_V2_CBOR("M"),
3939
ENDPOINT_OVERRIDE("N"),
4040
ACCOUNT_ID_MODE_PREFERRED("P"),

test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/BusinessMetricsUserAgentTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void when_paginatedOperationIsCalled_correctMetricIsAdded() throws Exception {
162162
}
163163

164164
@Test
165-
void when_compressedOperationIsCalled_metricIsRecordedButNotAddedToUserAgentString() throws Exception {
165+
void when_compressedOperationIsCalled_metricIsRecordedAndAddedToUserAgentString() throws Exception {
166166
ProtocolRestJsonAsyncClientBuilder clientBuilder = asyncClientBuilderForProtocolRestJson();
167167

168168
assertThatThrownBy(() -> clientBuilder.build().putOperationWithRequestCompression(r -> r.body(SdkBytes.fromUtf8String(
@@ -173,7 +173,7 @@ void when_compressedOperationIsCalled_metricIsRecordedButNotAddedToUserAgentStri
173173
BusinessMetricCollection attribute = interceptor.executionAttributes().getAttribute(SdkInternalExecutionAttribute.BUSINESS_METRICS);
174174
assertThat(attribute).isNotNull();
175175
assertThat(attribute.recordedMetrics()).contains(BusinessMetricFeatureId.GZIP_REQUEST_COMPRESSION.value());
176-
assertThat(userAgent).doesNotMatch(METRIC_SEARCH_PATTERN.apply(BusinessMetricFeatureId.GZIP_REQUEST_COMPRESSION.value()));
176+
assertThat(userAgent).matches(METRIC_SEARCH_PATTERN.apply(BusinessMetricFeatureId.GZIP_REQUEST_COMPRESSION.value()));
177177
}
178178

179179
private String assertAndGetUserAgentString() {

0 commit comments

Comments
 (0)