{"id":112254,"date":"2021-12-17T07:00:00","date_gmt":"2021-12-17T05:00:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=112254"},"modified":"2021-12-03T15:42:09","modified_gmt":"2021-12-03T13:42:09","slug":"spring-data-mock-dao","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html","title":{"rendered":"Spring Data Mock DAO"},"content":{"rendered":"<p>Warning, the following code example is suitable for a narrow range of use cases\u2026 but it\u2019s strangely useful.<\/p>\n<p>When writing tests against Spring services or controllers, we may wish to mock the DAO layer completely. This can be achieved:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">@MockBean\nprivate MyDao myDao;<\/pre>\n<p>And the mock dao is then wired into our services etc.<\/p>\n<p>However, there are situations where we\u2019re doing something complex in a higher order test, and we want this DAO to function just enough. This is where the following function may help:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">\/**\n * Turn any integer keyed mock dao into a sort of working one for save and findById\n *\n * @param mockDao the dao to mock\n * @param &lt;T&gt;     the type of element\n *\/\nstatic &lt;T&gt; void givenFakeSaveAndLoad(CrudRepository&lt;T, Integer&gt; mockDao,\n      Function&lt;T, Integer&gt; getId, BiConsumer&lt;T, Integer&gt; setId) {\n    Map&lt;Integer, T&gt; fakeDb = new HashMap&lt;&gt;();\n    AtomicInteger idGenerator = new AtomicInteger(123);\n    given(mockDao.save(any()))\n        .willAnswer(answer((T toSave) -&gt; {\n            if (getId.apply(toSave) == null) {\n                setId.accept(toSave, idGenerator.getAndIncrement());\n            }\n            fakeDb.put(getId.apply(toSave), toSave);\n            return toSave;\n        }));\n\n    willAnswer(answer((Integer id) -&gt; Optional.ofNullable(fakeDb.get(id))))\n        .given(mockDao)\n        .findById(argThat(id -&gt; id &gt;= 123));\n}<\/pre>\n<p>What this is doing is simulating a really simple database by using a <code>Map<\/code>. It can operate on any <code>CrudRepository<\/code> where the key field is an <code>Integer<\/code>. Technically you could make it operate on other key types if you wanted to. I\u2019m using <code>AtomicInteger<\/code> as the key generator here, so <code>Integer<\/code> is all I want.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>What this code does is puts a POJO in a <code>Map<\/code> on save and retrieves it from the <code>Map<\/code> on <code>findById<\/code>. There are many ways this is not enough of a mock of a database\u2026 but let\u2019s just look at an example of using it:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">givenFakeSaveAndLoad(learnerDriverDao,\n     LearnerDriver::getId,\n     LearnerDriver::setId);<\/pre>\n<p>We call it with the DAO we wish to mock and the functions on the POJO that access its ID field. Then it adds this moderately handy map-based DAO.<\/p>\n<h2 class=\"wp-block-heading\">Why It\u2019s Rubbish<\/h2>\n<p>Loads of reasons why this is not a good idea:<\/p>\n<ul class=\"wp-block-list\">\n<li>The POJO stored in the <code>Map<\/code> is mutable, so any code that modifies it will affect the <em>database\u2019s<\/em> copy.<\/li>\n<li>DAOs have many more methods than <code>save<\/code> and <code>findById<\/code> and this doesn\u2019t cover them<\/li>\n<li>Tests that rely on stateful mock objects soon get out of hand<\/li>\n<\/ul>\n<p>Conversely, this is a simple pattern that\u2019s really helped make a few tests easy!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Ashley Frieze, 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=\"https:\/\/codingcraftsman.wordpress.com\/2021\/11\/23\/spring-data-mock-dao\/\" target=\"_blank\" rel=\"noopener\">Spring Data Mock DAO<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Warning, the following code example is suitable for a narrow range of use cases\u2026 but it\u2019s strangely useful. When writing tests against Spring services or controllers, we may wish to mock the DAO layer completely. This can be achieved: @MockBean private MyDao myDao; And the mock dao is then wired into our services etc. However, &hellip;<\/p>\n","protected":false},"author":99480,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[321],"class_list":["post-112254","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Data Mock DAO - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services\" \/>\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\/2021\/12\/spring-data-mock-dao.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Data Mock DAO - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.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=\"2021-12-17T05:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.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=\"Ashley Frieze\" \/>\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=\"Ashley Frieze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html\"},\"author\":{\"name\":\"Ashley Frieze\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/85dca06872d91344dfc0c5945df7b6f2\"},\"headline\":\"Spring Data Mock DAO\",\"datePublished\":\"2021-12-17T05:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html\"},\"wordCount\":317,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring Data\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html\",\"name\":\"Spring Data Mock DAO - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2021-12-17T05:00:00+00:00\",\"description\":\"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/spring-data-mock-dao.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\":\"Spring Data Mock DAO\"}]},{\"@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\\\/85dca06872d91344dfc0c5945df7b6f2\",\"name\":\"Ashley Frieze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g\",\"caption\":\"Ashley Frieze\"},\"description\":\"Software developer, stand-up comedian, musician, writer, jolly big cheer-monkey, skeptical thinker, Doctor Who fan, lover of fine sounds\",\"sameAs\":[\"https:\\\/\\\/codingcraftsman.wordpress.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ashley-frieze\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Data Mock DAO - Java Code Geeks","description":"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services","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\/2021\/12\/spring-data-mock-dao.html","og_locale":"en_US","og_type":"article","og_title":"Spring Data Mock DAO - Java Code Geeks","og_description":"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services","og_url":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-12-17T05:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Ashley Frieze","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ashley Frieze","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html"},"author":{"name":"Ashley Frieze","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/85dca06872d91344dfc0c5945df7b6f2"},"headline":"Spring Data Mock DAO","datePublished":"2021-12-17T05:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html"},"wordCount":317,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring Data"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html","url":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html","name":"Spring Data Mock DAO - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2021-12-17T05:00:00+00:00","description":"Interested to learn about Mock DAO? Check our article explaining how mock the DAO layer completely when writing tests against Spring services","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/spring-data-mock-dao.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":"Spring Data Mock DAO"}]},{"@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\/85dca06872d91344dfc0c5945df7b6f2","name":"Ashley Frieze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d753fc078e89e8592e03ff7a6420076b218f9979578b537d0434a60274d9c557?s=96&d=mm&r=g","caption":"Ashley Frieze"},"description":"Software developer, stand-up comedian, musician, writer, jolly big cheer-monkey, skeptical thinker, Doctor Who fan, lover of fine sounds","sameAs":["https:\/\/codingcraftsman.wordpress.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/ashley-frieze"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112254","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\/99480"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=112254"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112254\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=112254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=112254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=112254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}