Created
December 6, 2022 22:04
-
-
Save oharaandrew314/8c7beef82bc1f72a319d984f9f183e18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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