<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JUNIT test for custom rest Endpoint using Mockito in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-for-custom-rest-endpoint-using-mockito/m-p/24730#M10738</link>
    <description>&lt;P&gt;I am following&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-process-services/alfresco-process-services-unit-testing-ii/ba-p/292894" target="_self" rel="nofollow noopener noreferrer"&gt;APS Junit&lt;/A&gt;&amp;nbsp; for testing aps custom logic.&lt;/P&gt;&lt;P&gt;I have JavaDelegate and&amp;nbsp; signal class.&lt;/P&gt;&lt;P&gt;I have custom endpoint which is calling third party api to fetch data, for that How Can I create UNIT Test case? without using Integration Testing and Using Mockito.&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;Regards,&lt;/P&gt;&lt;P&gt;Laxmi Mounika Boorela&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 10:34:17 GMT</pubDate>
    <dc:creator>Laxmi</dc:creator>
    <dc:date>2021-06-29T10:34:17Z</dc:date>
    <item>
      <title>JUNIT test for custom rest Endpoint using Mockito</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-for-custom-rest-endpoint-using-mockito/m-p/24730#M10738</link>
      <description>&lt;P&gt;I am following&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-process-services/alfresco-process-services-unit-testing-ii/ba-p/292894" target="_self" rel="nofollow noopener noreferrer"&gt;APS Junit&lt;/A&gt;&amp;nbsp; for testing aps custom logic.&lt;/P&gt;&lt;P&gt;I have JavaDelegate and&amp;nbsp; signal class.&lt;/P&gt;&lt;P&gt;I have custom endpoint which is calling third party api to fetch data, for that How Can I create UNIT Test case? without using Integration Testing and Using Mockito.&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;Regards,&lt;/P&gt;&lt;P&gt;Laxmi Mounika Boorela&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 10:34:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/junit-test-for-custom-rest-endpoint-using-mockito/m-p/24730#M10738</guid>
      <dc:creator>Laxmi</dc:creator>
      <dc:date>2021-06-29T10:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: JUNIT test for custom rest Endpoint using Mockito</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-for-custom-rest-endpoint-using-mockito/m-p/24731#M10739</link>
      <description>&lt;P&gt;I would just mock a sample response into mockito unit test case. In mockito framework its all about mocking, so if a service is expecting some response from third party or from a web url, we just mock a sample response to valiate all positive/negative test scenarios.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;public void testBlah() throws Exception {
    	
		.......
		......
    	final String endPoint = "https://example.com/getJson/xyzabc123";
		&lt;EM&gt;&lt;STRONG&gt;when(blahService.getJson(endPoint))
				.thenReturn(new JSONObject(getMockedResourceAsString("/files/test-sample.json")));&lt;/STRONG&gt;&lt;/EM&gt;
    	.....
        .....		
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jun 2021 14:12:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/junit-test-for-custom-rest-endpoint-using-mockito/m-p/24731#M10739</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2021-06-29T14:12:32Z</dc:date>
    </item>
  </channel>
</rss>

