07-09-2020 11:06 PM
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 02: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-11-2020 10:49 PM
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 02: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-11-2020 10:49 PM
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.