Example usage for com.amazonaws.http SdkHttpMetadata getHttpHeaders

List of usage examples for com.amazonaws.http SdkHttpMetadata getHttpHeaders

Introduction

In this page you can find the example usage for com.amazonaws.http SdkHttpMetadata getHttpHeaders.

Prototype

public Map<String, String> getHttpHeaders() 

Source Link

Usage

From source file:org.apache.beam.sdk.io.aws.sns.AmazonSNSMock.java

License:Apache License

@Override
public GetTopicAttributesResult getTopicAttributes(String topicArn) {
    GetTopicAttributesResult result = Mockito.mock(GetTopicAttributesResult.class);
    SdkHttpMetadata metadata = Mockito.mock(SdkHttpMetadata.class);
    Mockito.when(metadata.getHttpHeaders()).thenReturn(new HashMap<>());
    Mockito.when(metadata.getHttpStatusCode()).thenReturn(200);
    Mockito.when(result.getSdkHttpMetadata()).thenReturn(metadata);
    return result;
}

From source file:org.apache.beam.sdk.io.aws.sns.AmazonSNSMockSuccess.java

License:Apache License

@Override
public PublishResult publish(PublishRequest publishRequest) {
    PublishResult result = Mockito.mock(PublishResult.class);
    SdkHttpMetadata metadata = Mockito.mock(SdkHttpMetadata.class);
    Mockito.when(metadata.getHttpHeaders()).thenReturn(new HashMap<>());
    Mockito.when(metadata.getHttpStatusCode()).thenReturn(200);
    Mockito.when(result.getSdkHttpMetadata()).thenReturn(metadata);
    Mockito.when(result.getMessageId()).thenReturn(UUID.randomUUID().toString());
    return result;
}