Skip to content

Instantly share code, notes, and snippets.

@oharaandrew314
Created December 6, 2022 22:04
Show Gist options
  • Save oharaandrew314/8c7beef82bc1f72a319d984f9f183e18 to your computer and use it in GitHub Desktop.
Save oharaandrew314/8c7beef82bc1f72a319d984f9f183e18 to your computer and use it in GitHub Desktop.
repositories {
maven { setUrl("https://jitpack.io") }
}
dependencies {
implementation("com.github.oharaandrew314:dynamodb-kotlin-module:0.2.0")
implementation("software.amazon.awssdk:dynamodb-enhanced:2.18.24")
testImplementation("com.github.oharaandrew314:mock-aws-java-sdk:1.1.0")
}
import io.andrewohara.awsmock.dynamodb.MockDynamoDbV2
import io.andrewohara.dynamokt.DataClassTableSchema
import io.andrewohara.dynamokt.createTableWithIndices
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient
private fun testTable() = DynamoDbEnhancedClient.builder()
.dynamoDbClient(MockDynamoDbV2())
.build()
.table("cats", DataClassTableSchema(DynamoCat::class))
.also { it.createTableWithIndices() }
class V2DynamoCatsRepoTest: CatsRepoContract(V2DynamoCatsRepo(testTable()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment