{"id":43154,"date":"2019-01-09T06:51:31","date_gmt":"2019-01-09T06:51:31","guid":{"rendered":"https:\/\/www.softwaretestinghelp.com\/?page_id=43154"},"modified":"2025-04-01T08:07:16","modified_gmt":"2025-04-01T08:07:16","slug":"mockito-tutorial","status":"publish","type":"page","link":"https:\/\/www.softwaretestinghelp.com\/mockito-tutorial\/","title":{"rendered":"Mockito Tutorial: Mockito Framework for Mocking in Unit Testing"},"content":{"rendered":"<p><strong>A Complete Guide to Mockito Framework: Hands-on Mockito Tutorials<br \/>\n<\/strong><\/p>\n<p>Unit testing is a simple yet effective technique to gain a good level of confidence in the code that is to be shipped.<\/p>\n<p>Moreover, it avoids regression issues with every piece of code that gets checked in.<\/p>\n<p>With micro-services kind of architecture (and even for simple structure involving basic database calls), straightforward unit testing does not suffice. What we need is to mock the dependencies and test the actual logic of the method under test.<\/p>\n<p><em><strong> <\/strong><\/em><\/p>\n<p><a href=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Introduction-To.png\"><img decoding=\"async\" class=\"alignnone wp-image-43254 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Introduction-To.png\" alt=\"Mockito tutorial guide\" width=\"600\" height=\"301\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Introduction-To.png 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Introduction-To-300x151.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><span style=\"color: #ff6600;\"><strong>List of ALL Mockito Tutorials in this Series:<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Tutorial #1:<\/strong><\/span> <a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-tutorial\/\">Mockito Framework for Mocking in Unit Testing<\/a> (This Tutorial)<br \/>\n<span style=\"color: #000000;\"><strong>Tutorial #2:<\/strong><\/span> <a href=\"https:\/\/www.softwaretestinghelp.com\/mocks-spy-mockito\/\">Creating Mocks and Spies in Mockito<\/a><br \/>\n<span style=\"color: #000000;\"><strong>Tutorial #3:<\/strong><\/span> <a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-matchers\/\">Different Types of Matchers Provided by Mockito<\/a><br \/>\n<span style=\"color: #000000;\"><strong>Tutorial #4:<\/strong><\/span> <a href=\"https:\/\/www.softwaretestinghelp.com\/mock-private-static-void-methods-mockito\/\">Mocking Private, Static and Void Methods Using Mockito<\/a><br \/>\n<span style=\"color: #000000;\"><strong>Tutorial #5:<\/strong><\/span> <a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-inteview-questions\/\">Top 12 Mockito Interview Questions<\/a><\/p>\n<p>**********************************************************************<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Overview of Tutorials in this Mockito Series<\/strong><\/span><\/p>\n\n<div id=\"tablepress-520-scroll-wrapper\" class=\"tablepress-scroll-wrapper\">\n<table id=\"tablepress-520\" class=\"tablepress tablepress-id-520 tablepress-responsive\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Tutorial #<\/th><th class=\"column-2\">What You Will Learn<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\"><strong>Tutorial #1:<\/strong><\/td><td class=\"column-2\"><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-tutorial\/\">Mockito Framework for Mocking in Unit Testing<\/a><\/strong><br \/>\n<br \/>\nLearn mocking with Mockito - A comprehensive Mockito Tutorial for beginners with code examples. Learn Mocking Framework for Mocking in Unit Testing.<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\"><strong>Tutorial #2:<\/strong><\/td><td class=\"column-2\"><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/mocks-spy-mockito\/\">Creating Mocks and Spies in Mockito<\/a><\/strong><br \/>\n<br \/>\nMocks and Spies are types of test doubles, which are helpful in writing unit tests. Both are explained in this Mockito Spy tutorial with code examples.<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\"><strong>Tutorial #3:<\/strong><\/td><td class=\"column-2\"><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-matchers\/\">Different Types of Matchers Provided by Mockito<\/a><\/strong><br \/>\n<br \/>\nLearn how to use different types of matchers provided by Mockito. Matchers are like wildcards where instead of a specific input\/output, you specify a range of input. Argument and Verification are the two types of Matchers in Mockito which are explained in detail here.<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\"><strong>Tutorial #4:<\/strong><\/td><td class=\"column-2\"><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/mock-private-static-void-methods-mockito\/\">Mocking Private, Static and Void Methods Using Mockito<\/a><\/strong><br \/>\n<br \/>\nLearn Mocking Private, Static and Void methods in Mockito with Examples. Learn Mocking private and static methods by unit testing framework PowerMockito.<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\"><strong>Tutorial #5:<\/strong><\/td><td class=\"column-2\"><strong><a href=\"https:\/\/www.softwaretestinghelp.com\/mockito-inteview-questions\/\">Top 12 Mockito Interview Questions<\/a><\/strong><br \/>\n<br \/>\nMockito Interview Questions and answers with sample code examples. This will help you to crack any Mockito Mocking Framework interview successfully.<br \/>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<!-- #tablepress-520 from cache -->\n<p><em><strong>Let&#8217;s start with the first tutorial in this series!!<\/strong><\/em><\/p>\n<h3>Mocking in Unit testing<\/h3>\n<p>Mocks\/Stubs is a term that people commonly hear while creating unit tests in particular.<\/p>\n<p><strong> So, what essentially is Mocking?<\/strong> In simple terms, it&#8217;s nothing but providing a controlled instance or implementation of dependency that the code under test depends on in order to test its core logic.<\/p>\n<p>The reason I mentioned it as a controlled instance is that the behavior of the dependency can be programmed or controlled as desired for the method or system under test.<\/p>\n<p>To explain it diagrammatically, let\u2019s take an example of any Business or Ecommerce Application. Almost every such type of application primarily has 3 layers i.e. <strong>User Interface, Business Layer &amp; Data Access layer<\/strong> (which talks to the underlying data store)<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-43233 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/UnitTestingDependencies-1.jpg\" alt=\"Example: UnitTesting Dependencies\" width=\"650\" height=\"744\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/UnitTestingDependencies-1.jpg 650w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/UnitTestingDependencies-1-262x300.jpg 262w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>Referring to the above diagram, Business Layer has 3 dependencies namely i.e. Data Access Layer and 2 other services which are Service 1 and Service 2.<\/p>\n<p><strong>Look at it this way \u2013 An app like google maps can have dependencies on an<\/strong><\/p>\n<ol>\n<li>Actual data stores like MySQL or any other no SQL database which stores Map data.<\/li>\n<li>An external service like CoordinateService which provides latitudes and longitudes of a location.<\/li>\n<li>An external service like traffic service which provides real-time traffic information for a given Coordinate pair.<\/li>\n<\/ol>\n<p>So, if someone is trying to validate the core business logic using unit test, until and unless they have working implementations of these dependencies, the tests could not be run.<\/p>\n<p>Mocks come to rescue in these situations, where no matter your dependency is up and running or not, you are always guaranteed to run your business logic with a programmed response for the dependency that\u2019s being getting called from the code under test.<\/p>\n<h3>Types\/Categories of Test Doubles<\/h3>\n<p>Mock is essentially a type of \u201cTest Double\u201d \u2013 it\u2019s a tech jargon. \u201cTest Double\u201d essentially means an object which is replaced by equivalent real object instance or dependency.<\/p>\n<p><strong>There are different types of Test doubles as mentioned below:<\/strong><\/p>\n<h4><span style=\"color: #ff6600;\">#1) Fakes:<\/span><\/h4>\n<p>A fake is a working implementation similar to a real dependency, except the fact that it is local to the system under test.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example:<\/strong><\/span> Instead of hitting a real production DB, the test uses a simple collection\/in-memory to store data.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-43234 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Fakes.jpeg\" alt=\"Type of Test Doubles - Fakes\" width=\"600\" height=\"243\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Fakes.jpeg 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Fakes-300x122.jpeg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4><span style=\"color: #ff6600;\">#2) Stubs:<\/span><\/h4>\n<p>Stubs are pre-configured responses when a dependency is called from the system under test.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-43242 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Stubs-1.jpeg\" alt=\"Type of Test Doubles- Stubs\" width=\"600\" height=\"170\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Stubs-1.jpeg 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Stubs-1-300x85.jpeg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4><span style=\"color: #ff6600;\">#3) Spies:\u00a0<\/span><\/h4>\n<p>As the name suggests, its actually the real function (dependency) call with some watching mechanism. Post the call, it can be verified whether the call was actually triggered or not along with the parameters.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-43239 size-full\" src=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Spies.jpg\" alt=\"Type of Test Doubles- Spies\" width=\"600\" height=\"171\" srcset=\"https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Spies.jpg 600w, https:\/\/www.softwaretestinghelp.com\/wp-content\/qa\/uploads\/2018\/12\/Spies-300x86.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4><span style=\"color: #ff6600;\">#4) Mocks:\u00a0<\/span><\/h4>\n<p>Mocks are special instances of objects, on which Stubbed\/pre-configured responses can be specified. The fact that the mock got called can be verified as an assert in the test.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>For Example:<\/strong> <\/span><\/p>\n<p>There is a report generator function which sends an email to a specified address during execution.<\/p>\n<p>As we don\u2019t want to send actual email, again and again,\u00a0during testing, the EmailService is mocked (and the email method which sends the email is configured to do nothing when it\u2019s called). At the end of the test, we can just verify that the email sending method of the email service got called through the mocked object.<\/p>\n<h3>Different Mocking Frameworks<\/h3>\n<p>Almost all the languages provide different kinds of mocking frameworks. We will be writing a sample code using Mockito which is an open source Mocking framework for Java.<\/p>\n<p>Anatomy of a simple unit test with mocked dependency. Suppose, we are trying to unit test an application which calculates total marks for a student in all the subjects and writes it to DB.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void calculateSumAndStore(String studentId, int&#x5B;] scores)\r\n {\r\n    int total = 0;\r\n    for (int score: scores) {\r\n        total = total + score;\r\n    } \/\/ write total to DB\r\n    databaseImpl.updateScores(studentId, total);\r\n  }  \r\n\r\n<\/pre>\n<p>Now if we want to write a unit test for the method \u2013 calculateSumAndStore , then we might not be having a real implementation of a database to store the total. In that case, we won\u2019t ever be able to unit test this function.<\/p>\n<p>But with mocks in place, we can simply pass a Mock for database service and validate the rest of the logic<\/p>\n<p><span style=\"color: #ff6600;\"><strong>Sample test as shown below:<\/strong><\/span><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Test\r\npublic void calculateSumAndStore_withValidInput_shouldCalculateAndUpdateResultInDb()\r\n {\r\n   \/\/ Arrange\r\n    studentScores = new StudentScoreUpdates(mockDatabase);\r\n    int&#x5B;] scores = {  60, 70, 90  };\r\n    Mockito.doNothing().when(mockDatabase).updateScores(&quot;student1&quot;, 220); \r\n\r\n    \/\/ Act\r\n    studentScores.calculateSumAndStore(&quot;student1&quot;, scores); \r\n\r\n    \/\/ Assert\r\n    Mockito.verify(mockDatabase, Mockito.times(1)).updateScores(&quot;student1&quot;, 220);\r\n}\r\n<\/pre>\n<p>We seen in the above test, we have provided a mockDatabase object to the parent class (for the method under test) and we\u2019ve set up a stub response for the mockedDatabase object \u2013 Line#6 above <strong>(Mockito.doNothing().when(mockDatabase).updateScores(&#8220;student1&#8221;,\u00a0220);)<\/strong><\/p>\n<p><strong>The important points to note from the above are:<\/strong><\/p>\n<p><strong>#1)<\/strong> The mocked object need to setup stubbed responses for all the methods that will be called during the function execution.<\/p>\n<p><strong>#2)<\/strong> The parameters specified during stub creation can be specific or generic.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example<\/strong><\/span> in the above case \u2013 we have specified the parameters for the updateScores method as \u201cstudent1\u201d and 220 because we know that these are the exact inputs with which our method is going to be called.<\/p>\n<p><strong>#3) During verification, we are validating the following:<\/strong><\/p>\n<ul>\n<li>mockDatabase.updateScores method was called.<\/li>\n<li>Arguments were \u201cstudent1\u201d &amp; 220 respectively.<\/li>\n<li>The updateScores method was called 1 time.<\/li>\n<\/ul>\n<p><strong>Now let\u2019s try changing this test code a bit and see what happens:<\/strong><\/p>\n<p>I will change the argument in the mock setup from \u201cstudent1\u201d to anyString (Mockito provides a standard matcher named anyString()) &amp; 220 to anyInteger (Mockito provides a standard matcher named anyInt() and it matches any integer value)<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Test\r\npublic void calculateSumAndStore_withValidInput_shouldCalculateAndUpdateResultInDb()\r\n {\r\n   \/\/ Arrange\r\n    studentScores = new StudentScoreUpdates(mockDatabase);\r\n    int&#x5B;] scores = {  60, 70, 90  };\r\n    Mockito.doNothing().when(mockDatabase).updateScores(anyString(), anyInt()); \r\n\r\n    \/\/ Act\r\n    studentScores.calculateSumAndStore(&quot;student1&quot;, scores); \r\n\r\n    \/\/ Assert\r\n    Mockito.verify(mockDatabase, Mockito.times(1)).updateScores(&quot;student1&quot;, 220);\r\n}\r\n<\/pre>\n<p><strong>Try running the test again and The test should still be green.<\/strong><\/p>\n<p>[Now let\u2019s try changing the verification\/asserts and change any one of the arguments.<\/p>\n<p>Let&#8217;s change 220 to 230. Now the expectation is that the test should fail as this is not the expected argument that the databaseUpdate must have been called with.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Test\r\npublic void calculateSumAndStore_withValidInput_shouldCalculateAndUpdateResultInDb()\r\n {\r\n   \/\/ Arrange\r\n    studentScores = new StudentScoreUpdates(mockDatabase);\r\n    int&#x5B;] scores = {  60, 70, 90  };\r\n    Mockito.doNothing().when(mockDatabase).updateScores(anyString(), anyInt()); \r\n\r\n    \/\/ Act\r\n    studentScores.calculateSumAndStore(&quot;student1&quot;, scores); \r\n\r\n    \/\/ Assert\r\n    Mockito.verify(mockDatabase, Mockito.times(1)).updateScores(&quot;student1&quot;, 230);\r\n}\r\n<\/pre>\n<p>After running the test, refer to the error logs as shown below (it clearly mentions that the actual arguments did not match the expected ones).<\/p>\n<p><em><strong>Argument(s) are different! Wanted:<\/strong><\/em><br \/>\n<em>mockDatabase.updateScores(&#8220;student1&#8221;, 230);<\/em><br \/>\n<em>-&gt; at com.mocking.sampleMocks.StudentScoreUpdatesUnitTests.calculateSumAndStore_withValidInput_shouldCalculateAndUpdateResultInDb(StudentScoreUpdatesUnitTests.java:37)<\/em><\/p>\n<p><em><strong>Actual invocation has different arguments:<\/strong><\/em><br \/>\n<em>mockDatabase.updateScores(&#8220;student1&#8221;, 220);<\/em><\/p>\n<h3>Source code<\/h3>\n<p><strong>Interface &#8211; IDatabase.java<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic interface IDatabase { \r\n\r\npublic void updateScores(String studentId, int total);\r\n}<\/pre>\n<p><strong>Class Under Test &#8211; StudentScoreUpdates.java<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class StudentScoreUpdates {\r\npublic IDatabase databaseImpl; \r\n\r\npublic StudentScoreUpdates(IDatabase databaseImpl)\r\n{\r\nthis.databaseImpl = databaseImpl;\r\n} \r\n\r\npublic void calculateSumAndStore(String studentId, int&#x5B;] scores)\r\n{\r\nint total = 0;\r\nfor(int score : scores)\r\n{\r\ntotal = total + score;\r\n}\r\n\/\/ write total to DB\r\ndatabaseImpl.updateScores(studentId, total);\r\n}\r\n}\r\n<\/pre>\n<p><strong>Unit Tests Class &#8211; StudentScoreUpdatesUnitTests.java<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class StudentScoreUpdatesUnitTests { \r\n\r\n@Mock\r\npublic IDatabase mockDatabase; \r\n\r\npublic StudentScoreUpdates studentScores; \r\n\r\n@BeforeEach\r\npublic void beforeEach()\r\n{\r\nMockitoAnnotations.initMocks(this);\r\n} \r\n\r\n@Test\r\npublic void calculateSumAndStore_withValidInput_shouldCalculateAndUpdateResultInDb()\r\n{\r\n\/\/ Arrange\r\nstudentScores = new StudentScoreUpdates(mockDatabase);\r\nint&#x5B;] scores = {60,70,90};\r\nMockito.doNothing().when(mockDatabase).updateScores(anyString(), anyInt()); \r\n\r\n\/\/ Act\r\nstudentScores.calculateSumAndStore(&quot;student1&quot;, scores); \r\n\r\n\/\/ Assert\r\nMockito.verify(mockDatabase, Mockito.times(1)).updateScores(&quot;student1&quot;, 230);\r\n} \r\n\r\n}\r\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>What we saw so far is a very basic and straightforward example of Mock setup using Java\u2019s Mockito framework.<\/p>\n<p>For almost 60-70% of unit tests involving mocks the tests should have a similar structure. Mockito does provide a lot of advanced configuration\/support for extensive mocking needs, injecting mock instances using dependency injection, provides Spies to actually spy on a real method call and verify the calls.<\/p>\n<p><strong>Recommended reading =&gt; What Is <a href=\"https:\/\/www.softwaretestinghelp.com\/prototype-testing-tutorial\/\">Prototype Testing?<\/a><\/strong><\/p>\n<p><em><strong>Our upcoming tutorial will explain more about the Concept of Mocks and Spies in Mockito.<\/strong><\/em><\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/www.softwaretestinghelp.com\/mocks-spy-mockito\/\"><strong>NEXT Tutorial<\/strong><\/a><\/p>\n\r\n\t\t\t<div id=\"daexthefup-container\"\r\n\t\t\t\tclass=\"daexthefup-container daexthefup-layout-stacked daexthefup-alignment-center\"\r\n\t\t\t\tdata-post-id=\"43154\">\r\n\r\n\t\t\t\t<div class=\"daexthefup-feedback\">\r\n\t\t\t\t\t<div class=\"daexthefup-text\">\r\n\t\t\t\t\t\t<h3 class=\"daexthefup-title\">Was this helpful?<\/h3>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<div class=\"daexthefup-buttons-container\">\r\n\t\t\t\t\t\t<div class=\"daexthefup-buttons\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-yes daexthefup-button daexthefup-button-type-icon\" data-value=\"1\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-up-cls-1{fill:#c9c9c9;}.thumb-up-cls-2{fill:#e1e1e1;}.thumb-up-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_up\">\r\n                        <path class=\"thumb-up-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-up-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"20\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,9.06l-.49-.1c-.81-.17-1.61.35-1.78,1.16l-5.3,11.74c-.17.81,3.16,1.61,3.97,1.78l1.96.41c.81.17,1.61-.35,1.78-1.16l2.18-10.27c.34-1.61-.7-3.21-2.31-3.56Z\" \/>\r\n                            <path class=\"thumb-up-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,20h-18.67c-.83,0-1.5.67-1.5,1.5v12c0,.83.67,1.5,1.5,1.5h16.27c.71,0,1.33-.5,1.47-1.21l2.4-12c.19-.93-.53-1.8-1.47-1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t<div class=\"daexthefup-no daexthefup-button daexthefup-button-type-icon\" data-value=\"0\">\r\n\t\t\t\t\r\n                <svg>\r\n                    <defs>\r\n                        <style>.thumb-down-cls-1{fill:#c9c9c9;}.thumb-down-cls-2{fill:#e1e1e1;}.thumb-down-cls-3{fill:#676767;}<\/style>\r\n                    <\/defs>\r\n                    <g id=\"thumb_down\">\r\n                        <path class=\"thumb-down-cls-2 daexthefup-icon-circle\" d=\"m24,3c11.58,0,21,9.42,21,21s-9.42,21-21,21S3,35.58,3,24,12.42,3,24,3m0-1C11.85,2,2,11.85,2,24s9.85,22,22,22,22-9.85,22-22S36.15,2,24,2h0Z\" \/>\r\n                        <g>\r\n                            <rect class=\"thumb-down-cls-3 daexthefup-icon-secondary-color\" x=\"10\" y=\"13\" width=\"6\" height=\"15\" rx=\"1.5\" ry=\"1.5\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m30.57,38.94l-.49.1c-.81.17-1.61-.35-1.78-1.16l-5.3-11.74c-.17-.81,3.16-1.61,3.97-1.78l1.96-.41c.81-.17,1.61.35,1.78,1.16l2.18,10.27c.34,1.61-.7,3.21-2.31,3.56Z\" \/>\r\n                            <path class=\"thumb-down-cls-1 daexthefup-icon-primary-color\" d=\"m38.17,28h-18.67c-.83,0-1.5-.67-1.5-1.5v-12c0-.83.67-1.5,1.5-1.5h16.27c.71,0,1.33.5,1.47,1.21l2.4,12c.19.93-.53,1.8-1.47,1.8Z\" \/>\r\n                        <\/g>\r\n                    <\/g>\r\n                <\/svg>\t\t\t<\/div>\r\n\r\n\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-comment\">\r\n\t\t\t\t\t<div class=\"daexthefup-comment-top-container\">\r\n\t\t\t\t\t\t<label id=\"daexthefup-comment-label\" class=\"daexthefup-comment-label\"><\/label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-container\">\r\n\t\t\t\t\t\t\t\t<div id=\"daexthefup-comment-character-counter-number\"\r\n\t\t\t\t\t\t\t\t\tclass=\"daexthefup-comment-character-counter-number\"><\/div>\r\n\t\t\t\t\t\t\t\t<div class=\"daexthefup-comment-character-counter-text\"><\/div>\r\n\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<textarea id=\"daexthefup-comment-textarea\" class=\"daexthefup-comment-textarea\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Type your message\"\r\n\t\t\t\t\t\t\t\tmaxlength=\"\r\n\t\t\t\t\t\t\t\t400\t\t\t\t\t\t\t\t\t\"><\/textarea>\r\n\t\t\t\t\t<div class=\"daexthefup-comment-buttons-container\">\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-submit daexthefup-button\">Submit<\/button>\r\n\t\t\t\t\t\t<button class=\"daexthefup-comment-cancel daexthefup-button\">Cancel<\/button>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"daexthefup-successful-submission-text\">Thanks for your feedback!<\/div>\r\n\r\n\t\t\t<\/div>\r\n\r\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>A Complete Guide to Mockito Framework: Hands-on Mockito Tutorials Unit testing is a simple yet effective technique to gain a good level of confidence in the code that is to be shipped. Moreover, it avoids regression issues with every piece of code that gets checked in. With micro-services kind of &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Mockito Tutorial: Mockito Framework for Mocking in Unit Testing\" class=\"read-more button\" href=\"https:\/\/www.softwaretestinghelp.com\/mockito-tutorial\/#more-43154\" aria-label=\"Read more about Mockito Tutorial: Mockito Framework for Mocking in Unit Testing\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":43254,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_helpful_pro_status":1,"footnotes":""},"categories":[572],"tags":[],"class_list":{"0":"post-43154","1":"page","2":"type-page","3":"status-publish","4":"has-post-thumbnail","6":"category-framework"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/43154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/comments?post=43154"}],"version-history":[{"count":0,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/pages\/43154\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media\/43254"}],"wp:attachment":[{"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/media?parent=43154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/categories?post=43154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwaretestinghelp.com\/wp-json\/wp\/v2\/tags?post=43154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}