restweb-servicesibm-jazz

Unable to get RQM Test case by testcase title using REST API


I am using java RQM Rest API to fetch data from RQM tool

I have a test case in project CLM Test (Quality Management). The test case title is

Pre-Paid Residential Customer to Post-Paid Consumer (Qatari-National) Customer Migration.(Existing Customer having only prepaid subscription)

Internal Id is 3271 I am trying to fetch test case details from Test Suite. While fetching the test case details from TestSuite, I am getting the test case href as

<testcase href= "https://clm.techmahindra.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/CLM+Test+%28Quality+Management%29/testcase/Pre-Paid_Residential Customer_to_Post-Paid_Consumer_(Qatari-National)_Customer_Migration.(Existing_Customer_having_only_prepaid_subscription).xml" />

If you observe the test case href, it contains a space after 'Paid_Residential' so when querying the server with this href, I am getting URISyntaxException due to the space in string.

One more strange thing is: When I query server using RestClient(FireFox plugin) this query says 400 Error - Bad request. But when i click on testcase href as recieved in TestSuite record, I am able to get the testcase record.

Please help me to get this data.


Solution

  • It seems the title contains some special characters that throws URISyntaxException when we try to convert href to URI percentage encoding format. I initially used URI java class for conversion and it failed to convert the string (href= "https://clm.techmahindra.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/CLM+Test+%28Quality+Management%29/testcase/Pre-Paid_Residential Customer_to_Post-Paid_Consumer_(Qatari-National)_Customer_Migration.(Existing_Customer_having_only_prepaid_subscription).xml")

    But when I tried with URLEncoder class, it worked. Now I able to get record even for test cases having special characters in it.

    snippet:

    String strURI = URLEncoder.encode(href, "UTF-8");