Skip to content

Commit

Permalink
Fix: responseCompression option.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jan 11, 2023
1 parent f1fbe83 commit 2880734
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Make ChildrenAggregate as a SingleBucketAggregate ([#306](https://github.com/opensearch-project/opensearch-java/pull/306))
- Fix /_nodes/stats, /_nodes/info throwing serialization error ([#315](https://github.com/opensearch-project/opensearch-java/pull/315))
- Fix AwsSdk2TransportOptions.responseCompression ([#322](https://github.com/opensearch-project/opensearch-java/pull/322))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class DefaultImpl extends TransportOptions.DefaultImpl implements AwsSdk2Transpo
super(builder);
credentials = builder.credentials;
requestCompressionSize = builder.requestCompressionSize;
responseCompression = builder.responseCompression;
mapper = builder.mapper;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.client.transport.aws;

import org.junit.Assert;
import org.junit.Test;

public class AwsSdk2TransportOptionsTestCase extends Assert {
@Test
public void testBuilderResponseCompression() throws Exception {
AwsSdk2TransportOptions options = AwsSdk2TransportOptions.builder()
.setResponseCompression(true)
.setRequestCompressionSize(10)
.build();
assertEquals(10, options.requestCompressionSize().intValue());
assertTrue(options.responseCompression());
}
}

0 comments on commit 2880734

Please sign in to comment.