DynamoDBLocal and UnsatisfiedLinkError in Gradle

This week I started to work on a new project using DynamoDB. As always, I’d like to write some integration tests, to verify my datastore integration works as intended. I know one cheap way to test DynamoDB, is using containers and LocalStack. However, I decided to go even simpler and give DynamoDBLocal a spin. This is just a library, for your tests to depend on. Super easy to integrate in gradle or maven projects.

Unfortunately using DynamoDBLocal is not as straightforward. Relatively soon you might hit a UnsatisfiedLinkError related to SQLLite - similar to:







To fix this in a gradle build, we modified our test task, to copy some binaries around and also make a system property available to the tests.


One last pitfall might be your IntelliJ IDE. Delete all existing test configurations and make sure to run your tests using Gradle Runner.