{"id":112250,"date":"2021-12-13T07:00:00","date_gmt":"2021-12-13T05:00:00","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=112250"},"modified":"2021-12-03T14:55:33","modified_gmt":"2021-12-03T12:55:33","slug":"testing-promise-rejection-in-javascript-with-jest","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html","title":{"rendered":"Testing promise rejection in JavaScript with Jest"},"content":{"rendered":"<p><a name=\"more\"><\/a><\/p>\n<h2 class=\"wp-block-heading\">The code<\/h2>\n<p>Let\u2019s consider a simple function that returns a <code>Promise<\/code> that can either resolve or reject depending on the value of<br \/>the first argument:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">export default function promiseMe(result, timeout = 1000) {\n    return new Promise((resolve, reject) =&gt; {\n        setTimeout(() =&gt; {\n            if (result instanceof Error || result.startsWith(\"Error\")) {\n                reject(result)\n            } else {\n                resolve(result)\n            }\n        }, timeout)\n    })\n}<\/pre>\n<p>While testing async code with Jest the only thing to remember is to return <code>Promise<\/code> from the test so that Jest can<br \/>wait for it to resolve or to reject. The cleanest way is to do it with <code>.resolves<\/code> matcher:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">const successMessage = \"Done.\";\n\n\/\/ with async\/await\nit(\"resolves (1)\", async () =&gt; {\n    await expect(promiseMe(successMessage)).resolves.toEqual(successMessage);\n});\n\n\/\/ without async\/await\nit(\"resolves (2)\", () =&gt; {\n    return expect(promiseMe(successMessage)).resolves.toEqual(successMessage);\n});<\/pre>\n<p>In case the <code>Promise<\/code> rejects and the test did not expect that, Jest reports an error:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">Error: expect(received).resolves.toEqual()\n\nReceived promise rejected instead of resolved\nRejected to value: [...]<\/pre>\n<p>But what if one want to test <code>Promise<\/code> rejection and verify the rejection reason?<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2 class=\"wp-block-heading\">Try-catch with async\/await (bad)<\/h2>\n<p>It looks like using <code>try-catch<\/code> with <code>async\/await<\/code> is the easiest way to achieve this as the rejected value is thrown:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">it(\"rejects (bad)\", async () =&gt; {\n    try {\n        await promiseMe(\"Error\");\n    } catch (e) {\n        expect(e).toEqual(\"Error\");\n    }\n});<\/pre>\n<p>But wait. What happens when the <code>Promise<\/code> returned by <code>promiseMe<\/code> function won\u2019t reject, but it resolves instead? Well, the test still passes, as the catch block is never reached.<\/p>\n<p>See <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/await#promise_rejection\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Operators\/await#promise_rejection<\/a><\/p>\n<h2 class=\"wp-block-heading\">Try-catch with async\/await (better)<\/h2>\n<p>To overcome that issue, one could expect that the actual assertion will be executed and fail the test if it does not happen.<br \/>This can be done pretty easily with <code>expect.assertions<\/code> which verifies that a certain number of assertions are called<br \/>during a test:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">it(\"rejects (better)\", async () =&gt; {\n    expect.assertions(1);\n    try {\n        await promiseMe(\"Error\");\n    } catch (e) {\n        expect(e).toEqual(\"Error\");\n    }\n});<\/pre>\n<p>Now, when there is no rejection, the test fails:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">Error: expect.assertions(1)\n\nExpected one assertion to be called but received zero assertion calls.<\/pre>\n<h2 class=\"wp-block-heading\"><code>.rejects<\/code> (best)<\/h2>\n<p>To make the code even more expressive <code>.rejects<\/code> matcher can be used:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">it(\"rejects (best)\", async () =&gt; {\n    await expect(promiseMe(\"Error\")).rejects.toEqual(\"Error\");\n});<\/pre>\n<p>When there is no rejection, Jest reports an error:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">Error: expect(received).rejects.toEqual()  \n  \nReceived promise resolved instead of rejected  \nResolved to value: [...]<\/pre>\n<p>If the rejected value is an <code>Error<\/code> object, <code>toThrow<\/code> matcher can be used:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">it(\"rejects (best)\", async () =&gt; {\n    await expect(promiseMe(new Error(errorMessage))).rejects.toThrow(errorMessage);\n    await expect(promiseMe(new Error(errorMessage))).rejects.toThrow(Error); \/\/ type check\n    await expect(promiseMe(new Error(errorMessage))).rejects.toThrow(new Error(errorMessage));\n});<\/pre>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Rafal Borowiec, 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:\/\/blog.codeleak.pl\/2021\/11\/testing-promise-rejection-with-jest.html\" target=\"_blank\" rel=\"noopener\">Testing promise rejection in JavaScript with Jest<\/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>The code Let\u2019s consider a simple function that returns a Promise that can either resolve or reject depending on the value ofthe first argument: export default function promiseMe(result, timeout = 1000) { return new Promise((resolve, reject) =&gt; { setTimeout(() =&gt; { if (result instanceof Error || result.startsWith(&#8220;Error&#8221;)) { reject(result) } else { resolve(result) } }, &hellip;<\/p>\n","protected":false},"author":516,"featured_media":20900,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1879],"tags":[273],"class_list":["post-112250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Testing promise rejection in JavaScript with Jest - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest\" \/>\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\/testing-promise-rejection-in-javascript-with-jest.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Testing promise rejection in JavaScript with Jest - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.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-13T05:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-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=\"Rafal Borowiec\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/kolorobot\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rafal Borowiec\" \/>\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\\\/testing-promise-rejection-in-javascript-with-jest.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html\"},\"author\":{\"name\":\"Rafal Borowiec\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/b1a0b2657d5dd2459806446ac66d2d52\"},\"headline\":\"Testing promise rejection in JavaScript with Jest\",\"datePublished\":\"2021-12-13T05:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html\"},\"wordCount\":286,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"keywords\":[\"Testing\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html\",\"name\":\"Testing promise rejection in JavaScript with Jest - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"datePublished\":\"2021-12-13T05:00:00+00:00\",\"description\":\"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2021\\\/12\\\/testing-promise-rejection-in-javascript-with-jest.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Testing promise rejection in JavaScript with Jest\"}]},{\"@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\\\/b1a0b2657d5dd2459806446ac66d2d52\",\"name\":\"Rafal Borowiec\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g\",\"caption\":\"Rafal Borowiec\"},\"description\":\"Software developer, Team Leader, Agile practitioner, occasional blogger, lecturer. Open Source enthusiast, quality oriented and open-minded.\",\"sameAs\":[\"http:\\\/\\\/blog.codeleak.pl\\\/\",\"http:\\\/\\\/pl.linkedin.com\\\/in\\\/borowiec\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/kolorobot\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/rafal-borowiec\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Testing promise rejection in JavaScript with Jest - Java Code Geeks","description":"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest","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\/testing-promise-rejection-in-javascript-with-jest.html","og_locale":"en_US","og_type":"article","og_title":"Testing promise rejection in JavaScript with Jest - Java Code Geeks","og_description":"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest","og_url":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2021-12-13T05:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","type":"image\/jpeg"}],"author":"Rafal Borowiec","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/kolorobot","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Rafal Borowiec","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html"},"author":{"name":"Rafal Borowiec","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/b1a0b2657d5dd2459806446ac66d2d52"},"headline":"Testing promise rejection in JavaScript with Jest","datePublished":"2021-12-13T05:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html"},"wordCount":286,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","keywords":["Testing"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html","url":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html","name":"Testing promise rejection in JavaScript with Jest - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","datePublished":"2021-12-13T05:00:00+00:00","description":"Interested to learn about promise rejection? Check our article explaining how to test promise rejection in JavaScript with Jest","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2021\/12\/testing-promise-rejection-in-javascript-with-jest.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"JavaScript","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/javascript"},{"@type":"ListItem","position":4,"name":"Testing promise rejection in JavaScript with Jest"}]},{"@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\/b1a0b2657d5dd2459806446ac66d2d52","name":"Rafal Borowiec","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e24680b2ba3dfc13759acf6c1f125e54356bc533e0befe953fea365cadcdaffb?s=96&d=mm&r=g","caption":"Rafal Borowiec"},"description":"Software developer, Team Leader, Agile practitioner, occasional blogger, lecturer. Open Source enthusiast, quality oriented and open-minded.","sameAs":["http:\/\/blog.codeleak.pl\/","http:\/\/pl.linkedin.com\/in\/borowiec\/","https:\/\/x.com\/https:\/\/twitter.com\/kolorobot"],"url":"https:\/\/www.javacodegeeks.com\/author\/rafal-borowiec"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112250","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\/516"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=112250"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/112250\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/20900"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=112250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=112250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=112250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}