07-10-2020 02:06 AM
Hi,
I am following APS Junit for testing aps custom logic.
I have JavaDelegate and for that I am able to create jUnit Test case and it is working.
I have custom endpoint which is calling third party api to fetch data, for that How Can I craete Test case?
Any help would be appreciated.
07-10-2020 05:39 AM
You can take a look at the Integration Test example provided by my APS SDK:
You will find something like the following:
@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); }
Hope this helps
07-12-2020 01:49 AM
Hi,Your solution is working.
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.
I have solved above issue by excluding that test case from starting aps.
07-10-2020 05:39 AM
You can take a look at the Integration Test example provided by my APS SDK:
You will find something like the following:
@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); }
Hope this helps
07-12-2020 01:49 AM
Hi,Your solution is working.
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.
I have solved above issue by excluding that test case from starting aps.
Explore our Alfresco products with the links below. Use labels to filter content by product module.