• 0.22.3

Unit Testing w/Mock

Since version 0.10 you can use MkRegion class to mock interaction with DynamoDB without even starting DynamoDB Local:

public class FooTest {
  public void createsAndDeletesItems() {
    final Region region = new MkRegion(
      new H2Data().with(
        new String[] {"id"},
        new String[] {"name", "age"}
    final Table table = region.table("users");
      new Attributes()
        .with("id", 10783)
        .with("name", "Jeff Lebowski")
        .with("age", 35)
      Matchers.equalTo("Jeff Lebowski")

H2Data is using H2database for data persistency, that's why you should include these two dependencies to classpath: