{"id":21673,"date":"2015-06-25T12:54:11","date_gmt":"2015-06-25T07:24:11","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=21673"},"modified":"2015-10-08T16:24:00","modified_gmt":"2015-10-08T10:54:00","slug":"mocking-static-methods-in-junit-using-powermock","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/","title":{"rendered":"Mocking static methods in JUnit using PowerMock"},"content":{"rendered":"<p>We usually need\u00a0to mock lots of functionality while writing <a title=\"Node.js unit test\" href=\"https:\/\/tothenewco.pro\/blog\/node-js-unit-testing-with-jasmine-framework\/\" target=\"_blank\">unit tests<\/a>. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a\u00a0<a title=\"Grails upgrade services \" href=\"https:\/\/tothenewco.pro\/grails-application-development\" target=\"_blank\">bit different approach<\/a> due to their different nature. Assuming we have two utility classes with static functions and one class for which we need to write unit test case.<\/p>\n<p><strong>FirstUtility class:<\/strong><\/p>\n<p>[java]<\/p>\n<p>public class FirstUtil {<\/p>\n<p>\tpublic static String staticFunction(String parameter){<br \/>\n\t\treturn parameter;<br \/>\n\t}<\/p>\n<p>}<\/p>\n<p>[\/java]<\/p>\n<p><strong>SecondUtility class:<\/strong><\/p>\n<p>[java]<\/p>\n<p>public class SecondUtil {<\/p>\n<p>\tpublic static String staticFunction(String parameter){<br \/>\n        return parameter;<br \/>\n\t}<\/p>\n<p>}<\/p>\n<p>[\/java]<\/p>\n<p><strong>Class for Unit Test:<\/strong><\/p>\n<p>[java]<br \/>\npublic class ForTest {<br \/>\n\tpublic String executeFunction(){<br \/>\n\t\tFirstUtil.staticFunction(&quot;FirstUtil&quot;);<br \/>\n\t\tSecondUtil.staticFunction(&quot;SecondUtil&quot;);<br \/>\n\t\treturn &quot;success&quot;;<br \/>\n\t}<br \/>\n}<\/p>\n<p>[\/java]<\/p>\n<p>For the above code we need to mock two classes. So we need to include them in annotation &#8220;PrepareForTest&#8221;.<\/p>\n<p>[java]<\/p>\n<p>@PowerMockIgnore(&quot;org.apache.http.conn.ssl.*&quot;)<br \/>\n@RunWith(PowerMockRunner.class)<br \/>\n@PrepareForTest({FirstUtil.class,SecondUtil.class})<\/p>\n<p>public class TestToMockStatic {<\/p>\n<p>\t@Rule<\/p>\n<p>\t@Test<br \/>\n\t    public void testProductOrderProcessing() throws ClientProtocolException, IOException{<br \/>\n\t    \tPowerMockito.mockStatic(FirstUtil.class);\/\/For mocking static functions<br \/>\n\t    \tPowerMockito.mockStatic(SecondUtil.class);<\/p>\n<p>\t    \tMockito.when(FirstUtil.staticFunction(parameter)).thenReturn(mockedStaticFunction(parameter));<br \/>\n\t    \tMockito.when(SecondUtil.staticFunction(parameter)).thenReturn(mockedStaticFunction(parameter));<\/p>\n<p>\t    \tForTest forTest= new ForTest();<\/p>\n<p>\t    \tassertEquals(forTest.executeFunction(),&quot;success&quot;);<\/p>\n<p>\t    }<\/p>\n<p>\t    public void mockedStaticFunction(String parameter){<br \/>\n\t    \treturn parameter;<br \/>\n\t    }<\/p>\n<p>}<br \/>\n[\/java]<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Note :<\/strong> In above code you can see annotation @PowerMockIgnore . This is used to defer the loading of classes with the names supplied to value() to the system classloader.<\/p>\n<p>Maven dependencies for mocking framework:<\/p>\n<p>&nbsp;<\/p>\n<p>[xml]<br \/>\n        &lt;dependency&gt;<br \/>\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;<br \/>\n            &lt;artifactId&gt;powermock-core&lt;\/artifactId&gt;<br \/>\n            &lt;version&gt;1.6.2&lt;\/version&gt;<br \/>\n        &lt;\/dependency&gt;<\/p>\n<p>        &lt;dependency&gt;<br \/>\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;<br \/>\n            &lt;artifactId&gt;powermock-api-support&lt;\/artifactId&gt;<br \/>\n            &lt;version&gt;1.6.2&lt;\/version&gt;<br \/>\n        &lt;\/dependency&gt;<\/p>\n<p>        &lt;dependency&gt;<br \/>\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;<br \/>\n            &lt;artifactId&gt;powermock-module-junit4&lt;\/artifactId&gt;<br \/>\n            &lt;version&gt;${powermock.version}&lt;\/version&gt;<br \/>\n            &lt;scope&gt;test&lt;\/scope&gt;<br \/>\n        &lt;\/dependency&gt;<br \/>\n        &lt;dependency&gt;<br \/>\n            &lt;groupId&gt;org.powermock&lt;\/groupId&gt;<br \/>\n            &lt;artifactId&gt;powermock-api-mockito&lt;\/artifactId&gt;<br \/>\n            &lt;version&gt;${powermock.version}&lt;\/version&gt;<br \/>\n            &lt;scope&gt;test&lt;\/scope&gt;<br \/>\n        &lt;\/dependency&gt;<br \/>\n        &lt;dependency&gt;<br \/>\n            &lt;groupId&gt;org.mockito&lt;\/groupId&gt;<br \/>\n            &lt;artifactId&gt;mockito-core&lt;\/artifactId&gt;<br \/>\n            &lt;version&gt;1.8.5&lt;\/version&gt;<br \/>\n            &lt;scope&gt;test&lt;\/scope&gt;<br \/>\n        &lt;\/dependency&gt;<br \/>\n[\/xml]<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We usually need\u00a0to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a\u00a0bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class [&hellip;]<\/p>\n","protected":false},"author":226,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":16,"footnotes":""},"categories":[1818,446,1,1816],"tags":[1913,1912,1914,272],"class_list":["post-21673","post","type-post","status-publish","format-standard","hentry","category-automation-testing-testing-2","category-java","category-technology","category-testing-2","tag-mockito","tag-powermock","tag-static-function","tag-unit-test"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Haider Ali\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#article\",\"name\":\"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog\",\"headline\":\"Mocking static methods in JUnit using PowerMock\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/haider-ali\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2015-06-25T12:54:11+05:30\",\"dateModified\":\"2015-10-08T16:24:00+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#webpage\"},\"articleSection\":\"Automation Testing, Java\\\/JVM, Technology, Testing, Mockito, PowerMock, Static function, unit-test\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#listItem\",\"name\":\"Mocking static methods in JUnit using PowerMock\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#listItem\",\"position\":3,\"name\":\"Mocking static methods in JUnit using PowerMock\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/haider-ali\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/haider-ali\\\/\",\"name\":\"Haider Ali\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/8795ceb8-cced-423d-b19f-9a46bd630dd2_haider.ali@tothenew.com.jpg\",\"width\":96,\"height\":96,\"caption\":\"Haider Ali\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/\",\"name\":\"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog\",\"description\":\"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/mocking-static-methods-in-junit-using-powermock\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/haider-ali\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/haider-ali\\\/#author\"},\"datePublished\":\"2015-06-25T12:54:11+05:30\",\"dateModified\":\"2015-10-08T16:24:00+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog","description":"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class","canonical_url":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#article","name":"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog","headline":"Mocking static methods in JUnit using PowerMock","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/haider-ali\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"datePublished":"2015-06-25T12:54:11+05:30","dateModified":"2015-10-08T16:24:00+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#webpage"},"articleSection":"Automation Testing, Java\/JVM, Technology, Testing, Mockito, PowerMock, Static function, unit-test"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/tothenewco.pro\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#listItem","name":"Mocking static methods in JUnit using PowerMock"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#listItem","position":3,"name":"Mocking static methods in JUnit using PowerMock","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/haider-ali\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/haider-ali\/","name":"Haider Ali","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/8795ceb8-cced-423d-b19f-9a46bd630dd2_haider.ali@tothenew.com.jpg","width":96,"height":96,"caption":"Haider Ali"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/","name":"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog","description":"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/haider-ali\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/haider-ali\/#author"},"datePublished":"2015-06-25T12:54:11+05:30","dateModified":"2015-10-08T16:24:00+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog","og:description":"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class","og:url":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Mocking static methods in JUnit using PowerMock | TO THE NEW Blog","twitter:description":"We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one class","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"21673","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 00:26:03","updated":"2024-02-29 09:34:09","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/tothenewco.pro\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMocking static methods in JUnit using PowerMock\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Technology","link":"https:\/\/tothenewco.pro\/blog\/category\/technology\/"},{"label":"Mocking static methods in JUnit using PowerMock","link":"https:\/\/tothenewco.pro\/blog\/mocking-static-methods-in-junit-using-powermock\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/21673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/226"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=21673"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/21673\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=21673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=21673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=21673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}