-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vacha Shah <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...nt/src/test/java/org/opensearch/client/opensearch/integTest/aws/AwsSdk2TransportMock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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.opensearch.integTest.aws; | ||
|
||
import org.opensearch.client.transport.Endpoint; | ||
import org.opensearch.client.transport.TransportOptions; | ||
import org.opensearch.client.transport.aws.AwsSdk2Transport; | ||
import org.opensearch.client.transport.aws.AwsSdk2TransportOptions; | ||
import org.opensearch.client.util.OpenSearchRequestBodyBuffer; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
import software.amazon.awssdk.http.SdkHttpFullRequest; | ||
import software.amazon.awssdk.regions.Region; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.annotation.CheckForNull; | ||
import javax.annotation.Nonnull; | ||
|
||
public class AwsSdk2TransportMock extends AwsSdk2Transport { | ||
|
||
public AwsSdk2TransportMock( | ||
@Nonnull SdkHttpClient httpClient, | ||
@Nonnull String host, | ||
@Nonnull String signingServiceName, | ||
@Nonnull Region signingRegion, | ||
@CheckForNull AwsSdk2TransportOptions options) { | ||
super(httpClient, null, host, signingServiceName, signingRegion, options); | ||
} | ||
|
||
@Override | ||
public <RequestT> OpenSearchRequestBodyBuffer prepareRequestBody(RequestT request, | ||
Endpoint<RequestT, ?, ?> endpoint, TransportOptions options) throws IOException { | ||
return super.prepareRequestBody(request, endpoint, options); | ||
} | ||
@Override | ||
public <RequestT> SdkHttpFullRequest prepareRequest(RequestT request, Endpoint<RequestT, ?, ?> endpoint, | ||
TransportOptions options, OpenSearchRequestBodyBuffer body) { | ||
return super.prepareRequest(request, endpoint, options, body); | ||
} | ||
} |