package com.github.mlk.junit.rules;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
import com.github.mlk.junit.rules.helpers.dynamodb.DynamoExample;
import java.util.UUID;
import org.junit.Rule;
import org.junit.Test;

public class HttpDynamoDbRuleTest {
  @Rule
  public HttpDynamoDbRule subject = new HttpDynamoDbRule();

  @Test
  public void getterSetterTest() {
    String randomValue = UUID.randomUUID().toString();

    DynamoExample exampleClient = new DynamoExample(AmazonDynamoDBClientBuilder
        .standard()
        .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("anything", "anything")))
        .withEndpointConfiguration(new EndpointConfiguration(subject.getEndpoint(), "eu-west-1"))
        .build());
    exampleClient.createTable();
    exampleClient.setValue(1L, randomValue);

    assertThat(exampleClient.getValue(1L), is(randomValue));
  }
}
@@ -127,111 +127,8 @@
 s;%0A%0A
-import com.amazonaws.auth.AWSStaticCredentialsProvider;%0Aimport com.amazonaws.auth.BasicAWSCredentials;%0A
 impo
@@ -713,116 +713,8 @@
 d()%0A
-        .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(%22anything%22, %22anything%22)))%0A
     

Support for setting fake AWS creds