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.
Solved! Go to Solution.
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
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.
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
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.