Example usage for com.amazonaws.http SdkHttpMetadata getHttpStatusCode

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

Introduction

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

Prototype

public int getHttpStatusCode() 

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;
}