{"id":85629,"date":"2019-01-07T10:00:54","date_gmt":"2019-01-07T08:00:54","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=85629"},"modified":"2019-01-06T13:43:09","modified_gmt":"2019-01-06T11:43:09","slug":"testing-dynamodb-using-junit5","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html","title":{"rendered":"Unit testing DynamoDB applications using JUnit5"},"content":{"rendered":"<p>In a\u00a0<a href=\"https:\/\/www.javacodegeeks.com\/2018\/12\/reactive-spring-webflux-aws-dynamodb.html\">previous post<\/a> I had described the new AWS SDK for Java 2 which provides non-blocking IO support for Java clients calling different AWS services. In this post I will go over an approach that I have followed to unit test the AWS DynamoDB calls.<\/p>\n<p>There are a few ways to spin up a local version of DynamoDB &#8211;<\/p>\n<p>1. AWS provides a\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/amazondynamodb\/latest\/developerguide\/DynamoDBLocal.DownloadingAndRunning.html\">DynamoDB local<\/a><\/p>\n<p>2.\u00a0<a href=\"https:\/\/github.com\/localstack\/localstack\">Localstack<\/a> provides a way to spin up a good number of AWS services locally<\/p>\n<p>3. A docker version of\u00a0<a href=\"https:\/\/hub.docker.com\/r\/amazon\/dynamodb-local\/\">DynamoDB Local<\/a><\/p>\n<p>4.\u00a0<a href=\"https:\/\/github.com\/mhart\/dynalitehttp:\/\/\">Dynalite<\/a>, a node based implementation of DynamoDB<\/p>\n<p>Now to be able to unit test an application, I need to be able to start up an embedded version of DynamoDB using one of these options right before a test runs and then shut it down after a test completes. There are three approaches that I have taken:<\/p>\n<p>1. Using a\u00a0<a href=\"https:\/\/junit.org\/junit5\/docs\/current\/user-guide\/#extensions\">JUnit 5 extension<\/a> that internally brings up a AWS DynamoDB Local and spins it down after a test.<\/p>\n<p>2. Using\u00a0<a href=\"https:\/\/www.testcontainers.org\/\">testcontainers<\/a> to start up a docker version DynamoDB Local<\/p>\n<p>3. Using\u00a0<a href=\"https:\/\/www.testcontainers.org\/\">testcontainers<\/a> to start up\u00a0<a href=\"https:\/\/github.com\/mhart\/dynalite\">DynaLite<\/a><\/p>\n<h2>JUnit5 extension<\/h2>\n<p><a href=\"https:\/\/junit.org\/junit5\/docs\/current\/user-guide\/#extensions\">JUnit5 extension<\/a> provides a convenient hook point to start up an<br \/>\n<a href=\"https:\/\/github.com\/aws-samples\/aws-dynamodb-examples\/blob\/master\/src\/test\/java\/com\/amazonaws\/services\/dynamodbv2\/DynamoDBLocalFixture.java\">embedded<\/a> version of DynamoDB for tests. It works by pulling in a version of DynamoDB Local as a maven dependency:<\/p>\n<pre class=\"brush:java\">dependencies {\n    ...\n testImplementation(\"com.amazonaws:DynamoDBLocal:1.11.119\")\n    ...\n}<\/pre>\n<p>A complication with this dependency is that there are native components (dll, .so etc) that the DynamoDB Local interacts with and to get these in the right place, I depend on a Gradle task:<\/p>\n<pre class=\"brush:java\">task copyNativeDeps(type: Copy) {\n mkdir \"build\/native-libs\"\n from(configurations.testCompileClasspath) {\n  include '*.dll'\n  include '*.dylib'\n  include '*.so'\n }\n into 'build\/native-libs'\n}\n\ntest {\n dependsOn copyNativeDeps\n}<\/pre>\n<p>which puts the native libs in build\/native-libs folder, and the extension internally sets this path as a system property:<\/p>\n<pre class=\"brush:java\">System.setProperty(\"sqlite4java.library.path\", libPath.toAbsolutePath().toString())<\/pre>\n<p>Here is the codebase to the JUnit5 extension with all these already hooked up &#8211; https:\/\/github.com\/bijukunjummen\/boot-with dynamodb\/blob\/master\/src\/test\/kotlin\/sample\/dyn\/rules\/LocalDynamoExtension.kt<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>A test using this extension looks like this:<\/p>\n<pre class=\"brush:java\">class HotelRepoTest {\n    companion object {\n        @RegisterExtension\n        @JvmField\n        val localDynamoExtension = LocalDynamoExtension()\n\n        @BeforeAll\n        @JvmStatic\n        fun beforeAll() {\n            val dbMigrator = DbMigrator(localDynamoExtension.syncClient!!)\n            dbMigrator.migrate()\n        }\n\n    }\n    @Test\n    fun saveHotel() {\n        val hotelRepo = DynamoHotelRepo(localDynamoExtension.asyncClient!!)\n        val hotel = Hotel(id = \"1\", name = \"test hotel\", address = \"test address\", state = \"OR\", zip = \"zip\")\n        val resp = hotelRepo.saveHotel(hotel)\n\n        StepVerifier.create(resp)\n                .expectNext(hotel)\n                .expectComplete()\n                .verify()\n    }\n}<\/pre>\n<p>The code can interact with a fully featured DynamoDB.<\/p>\n<h2><a href=\"https:\/\/www.testcontainers.org\/\">TestContainers<\/a> with DynamoDB Local Docker<\/h2>\n<p>The JUnit5 extensions approach works well but it requires an additional dependency with native binaries to be pulled in. A cleaner approach may be to use the excellent\u00a0<a href=\"https:\/\/www.testcontainers.org\/\">Testcontainers<\/a> to spin up a docker version of DynamoDB Local the following way:<\/p>\n<pre class=\"brush:java\">class HotelRepoLocalDynamoTestContainerTest {\n    @Test\n    fun saveHotel() {\n        val hotelRepo = DynamoHotelRepo(getAsyncClient(dynamoDB))\n        val hotel = Hotel(id = \"1\", name = \"test hotel\", address = \"test address\", state = \"OR\", zip = \"zip\")\n        val resp = hotelRepo.saveHotel(hotel)\n\n        StepVerifier.create(resp)\n                .expectNext(hotel)\n                .expectComplete()\n                .verify()\n    }\n\n\n\n    companion object {\n        val dynamoDB: KGenericContainer = KGenericContainer(\"amazon\/dynamodb-local:1.11.119\")\n                .withExposedPorts(8000)\n\n        @BeforeAll\n        @JvmStatic\n        fun beforeAll() {\n            dynamoDB.start()\n        }\n\n        @AfterAll\n        @JvmStatic\n        fun afterAll() {\n            dynamoDB.stop()\n        }\n\n        fun getAsyncClient(dynamoDB: KGenericContainer): DynamoDbAsyncClient {\n            val endpointUri = \"http:\/\/\" + dynamoDB.getContainerIpAddress() + \":\" +\n                    dynamoDB.getMappedPort(8000)\n            val builder: DynamoDbAsyncClientBuilder = DynamoDbAsyncClient.builder()\n                    .endpointOverride(URI.create(endpointUri))\n                    .region(Region.US_EAST_1)\n                    .credentialsProvider(StaticCredentialsProvider\n                            .create(AwsBasicCredentials\n                                    .create(\"acc\", \"sec\")))\n            return builder.build()\n        }\n\n        ...\n    }\n}<\/pre>\n<p>This code starts up DynamoDB at a random unoccupied port and provides this information so that the client can be created using this information. There is a little Kotlin workaround that I had to do based on an issue reported <a href=\"https:\/\/github.com\/testcontainers\/testcontainers-java\/issues\/318\">here.<\/a><\/p>\n<h2><a href=\"https:\/\/www.testcontainers.org\/\">TestContainers<\/a> with Dynalite<\/h2>\n<p><a href=\"https:\/\/github.com\/mhart\/dynalite\">Dynalite<\/a> is a javascript based implementation of DynamoDB and can be run for tests again using the TestContainer approach. This time however there is already a\u00a0<a href=\"https:\/\/github.com\/testcontainers\/testcontainers-java\/tree\/master\/modules\/dynalite\">TestContainer module for Dynalite<\/a>. I found that it does not support JUnit5 and sent a\u00a0<a href=\"https:\/\/github.com\/testcontainers\/testcontainers-java\/pull\/1114\">Pull request<\/a> to provide this support, in the iterim the raw docker image can be used and this is how a test looks like:<\/p>\n<pre class=\"brush:java\">class HotelRepoDynaliteTestContainerTest {\n    @Test\n    fun saveHotel() {\n        val hotelRepo = DynamoHotelRepo(getAsyncClient(dynamoDB))\n        val hotel = Hotel(id = \"1\", name = \"test hotel\", address = \"test address\", state = \"OR\", zip = \"zip\")\n        val resp = hotelRepo.saveHotel(hotel)\n\n        StepVerifier.create(resp)\n                .expectNext(hotel)\n                .expectComplete()\n                .verify()\n    }\n\n    companion object {\n        val dynamoDB: KGenericContainer = KGenericContainer(\"quay.io\/testcontainers\/dynalite:v1.2.1-1\")\n                .withExposedPorts(4567)\n\n        @BeforeAll\n        @JvmStatic\n        fun beforeAll() {\n            dynamoDB.start()\n            val dbMigrator = DbMigrator(getSyncClient(dynamoDB))\n            dbMigrator.migrate()\n        }\n\n        @AfterAll\n        @JvmStatic\n        fun afterAll() {\n            dynamoDB.stop()\n        }\n\n        fun getAsyncClient(dynamoDB: KGenericContainer): DynamoDbAsyncClient {\n            val endpointUri = \"http:\/\/\" + dynamoDB.getContainerIpAddress() + \":\" +\n                    dynamoDB.getMappedPort(4567)\n            val builder: DynamoDbAsyncClientBuilder = DynamoDbAsyncClient.builder()\n                    .endpointOverride(URI.create(endpointUri))\n                    .region(Region.US_EAST_1)\n                    .credentialsProvider(StaticCredentialsProvider\n                            .create(AwsBasicCredentials\n                                    .create(\"acc\", \"sec\")))\n            return builder.build()\n        }\n        ...\n    }\n}<\/pre>\n<h2>Conclusion<\/h2>\n<p>All of the approaches are useful in being able to test integration with DynamoDB. My personal preference is using the TestContainers approach if a docker agent is available else with the JUnit5 extension approach. The samples with fully working tests using all the three approaches are available in my github repo &#8211; https:\/\/github.com\/bijukunjummen\/boot-with-dynamodb<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Java Code Geeks with permission by Biju Kunjummen, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/www.java-allandsundry.com\/2019\/01\/unit-testing-dynamodb-applications.html\" target=\"_blank\" rel=\"noopener\">Unit testing DynamoDB applications using JUnit5<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In a\u00a0previous post I had described the new AWS SDK for Java 2 which provides non-blocking IO support for Java clients calling different AWS services. In this post I will go over an approach that I have followed to unit test the AWS DynamoDB calls. There are a few ways to spin up a local &hellip;<\/p>\n","protected":false},"author":236,"featured_media":176,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1365,1816,273],"class_list":["post-85629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-dynamodb","tag-junit5","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Unit testing DynamoDB applications using JUnit5 - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Unit testing DynamoDB applications using JUnit5 - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-07T08:00:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Biju Kunjummen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Biju Kunjummen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html\"},\"author\":{\"name\":\"Biju Kunjummen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\"},\"headline\":\"Unit testing DynamoDB applications using JUnit5\",\"datePublished\":\"2019-01-07T08:00:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html\"},\"wordCount\":565,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/junit-logo-e1426444701180.jpg\",\"keywords\":[\"DynamoDB\",\"JUnit5\",\"Testing\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html\",\"name\":\"Unit testing DynamoDB applications using JUnit5 - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/junit-logo-e1426444701180.jpg\",\"datePublished\":\"2019-01-07T08:00:54+00:00\",\"description\":\"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/junit-logo-e1426444701180.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/junit-logo-e1426444701180.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/01\\\/testing-dynamodb-using-junit5.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Unit testing DynamoDB applications using JUnit5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/802eedfe6f17c3c13fa656af46b6b0e5\",\"name\":\"Biju Kunjummen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g\",\"caption\":\"Biju Kunjummen\"},\"sameAs\":[\"http:\\\/\\\/biju-allandsundry.blogspot.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Biju-Kunjummen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Unit testing DynamoDB applications using JUnit5 - Java Code Geeks","description":"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html","og_locale":"en_US","og_type":"article","og_title":"Unit testing DynamoDB applications using JUnit5 - Java Code Geeks","og_description":"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.","og_url":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-01-07T08:00:54+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg","type":"image\/jpeg"}],"author":"Biju Kunjummen","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Biju Kunjummen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html"},"author":{"name":"Biju Kunjummen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5"},"headline":"Unit testing DynamoDB applications using JUnit5","datePublished":"2019-01-07T08:00:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html"},"wordCount":565,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg","keywords":["DynamoDB","JUnit5","Testing"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html","url":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html","name":"Unit testing DynamoDB applications using JUnit5 - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg","datePublished":"2019-01-07T08:00:54+00:00","description":"Interested to learn about DynamoDB applications? Check our article explaining how to unit test the AWS DynamoDB calls using Junit 5.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/junit-logo-e1426444701180.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/01\/testing-dynamodb-using-junit5.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Unit testing DynamoDB applications using JUnit5"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/802eedfe6f17c3c13fa656af46b6b0e5","name":"Biju Kunjummen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/66af1504c76f011746c89812efce168850f07dce91ce881e62795e10c99d30b3?s=96&d=mm&r=g","caption":"Biju Kunjummen"},"sameAs":["http:\/\/biju-allandsundry.blogspot.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/Biju-Kunjummen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/85629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/236"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=85629"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/85629\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/176"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=85629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=85629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=85629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}