Skip to content

Commit

Permalink
Fix: responseCompression option. (#322) (#327)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>

(cherry picked from commit 4165674)

Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and dblock authored Jan 17, 2023
1 parent 0c498c0 commit aa9daf4
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 @@ -25,6 +25,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 aa9daf4

Please sign in to comment.