<?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 Case for Custom Rest Endpoint in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41358#M17355</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&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 for that I am able to create jUnit Test case and it is working.&lt;/P&gt;&lt;P&gt;I have custom endpoint which is calling third party api to fetch data, for that How Can I craete Test case?&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 06:06:21 GMT</pubDate>
    <dc:creator>sp2</dc:creator>
    <dc:date>2020-07-10T06:06:21Z</dc:date>
    <item>
      <title>Junit Test Case for Custom Rest Endpoint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41358#M17355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&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 for that I am able to create jUnit Test case and it is working.&lt;/P&gt;&lt;P&gt;I have custom endpoint which is calling third party api to fetch data, for that How Can I craete Test case?&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 06:06:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41358#M17355</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-07-10T06:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Junit Test Case for Custom Rest Endpoint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41359#M17356</link>
      <description>&lt;P&gt;You can take a look at the Integration Test example provided by my APS SDK:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/aps-extensions-jar/src/test/java/org/alfresco/activiti/integration/tests/FourEyesAppIT.java" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/aps-extensions-jar/src/test/java/org/alfresco/activiti/integration/tests/FourEyesAppIT.java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You will find something like the following:&lt;/P&gt;
&lt;PRE&gt;@Test
	public void testCustomPrivateRestEndpoint() throws Exception {
		String url = getEnterpriseApiURL("my-api-endpoint");

		// append query string parameters here

		executeGETRequest(url, adminUserForPrivateApi, HttpStatus.OK);
	}

	@Test
	public void testCustomPublicRestEndpoint() throws Exception {
		String url = getPrivateApiURL("my-rest-endpoint");

		// append query string parameters here

		executeGETRequest(url, adminUserForPrivateApi, HttpStatus.OK);
	}&lt;/PRE&gt;
&lt;P&gt;Hope this helps &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:39:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41359#M17356</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2020-07-10T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Junit Test Case for Custom Rest Endpoint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41360#M17357</link>
      <description>&lt;P&gt;Hi,Your solution is working.&lt;/P&gt;&lt;P&gt;But the problem is that My Test case is executing when I start my sdk(docker base) and it is trying call that api and failing because aps is not still start.&lt;/P&gt;&lt;P&gt;I have solved above issue by excluding that test case from starting aps.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jul 2020 05:49:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/junit-test-case-for-custom-rest-endpoint/m-p/41360#M17357</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-07-12T05:49:41Z</dc:date>
    </item>
  </channel>
</rss>

