I am trying to run DynamoDB local for testing purposes. I followed the steps amazon provides for setting it up and running the jar by itself works fine (link to amazon's tutorial Here). However, the tutorial doesn't go over running the jar within your own project. I don't want all the other developers to have to grab a jar and run it locally every time they test their code.
That is where my question comes in. I've had a real hard time finding any examples online of how to configure a Gradle project to run the DynamoDB local server as part of my tests. I found the following maven example https://github.com/awslabs/aws-dynamodb-examples/blob/master/src/test/java/com/amazonaws/services/dynamodbv2/DynamoDBLocalFixture.java#L32 and am trying to convert it to a Gradle, but am getting errors for all of com.amazonaws.services.dynamodbv2.local
import statements they are using. The errors are that the resource cannot be found.
I went into their project's pom and put the following into my build.gradle
file to emulate it.
//dynamodb local dependencies testCompile('com.amazonaws:aws-java-sdk-dynamodb:1.10.42') testCompile('com.amazonaws:aws-java-sdk-cloudwatch:1.10.42') testCompile('com.amazonaws:aws-java-sdk:1.3.0') testCompile('com.amazonaws:amazon-kinesis-client:1.6.1') testCompile('com.amazonaws:amazon-kinesis-connectors:1.1.1') testCompile('com.amazonaws:dynamodb-streams-kinesis-adapter:1.0.2') testCompile('com.amazonaws:DynamoDBLocal:1.10.5.1')
The import statements still fail. Here is an example of one that fails.
import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded;
TL;DR
Has anyone managed to get the DynamoDB local JAR to execute as part of a Gradle project or have a link to a good tutorial (it doesn't have to be the tutorial I linked to).