无法使用 REST 按测试用例标题获取 RQM 测试用例 API

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

我正在使用 java RQM Rest API 从 RQM 工具中获取数据

我在项目 CLM 测试(质量管理)中有一个测试用例。 测试用例标题是

Pre-Paid 居民客户到 Post-Paid 消费者 (Qatari-National) 客户迁移。(现有客户只有预付费订阅)

内部 ID 是 3271 我正在尝试从测试套件中获取测试用例详细信息。 从 TestSuite 获取测试用例详细信息时,我得到的测试用例 href 为

<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" />

如果您观察测试用例 href,它在 'Paid_Residential' 之后包含一个 space 因此,当使用此 href 查询服务器时,由于字符串中的 space,我得到 URISyntaxException

更奇怪的是: 当我使用 RestClient(FireFox 插件)查询服务器时,此查询显示 400 错误 - 错误请求。但是当我点击 TestSuite 记录中收到的测试用例 href 时,我能够获得测试用例记录。

请帮我获取这些数据。

似乎标题包含一些特殊字符,当我们尝试将 href 转换为 URI 百分比编码格式时,会抛出 URISyntaxException。我最初使用 URI java class 进行转换,但它无法转换字符串 (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")

但是当我尝试使用 URLEncoder class 时,它起作用了。现在,即使是包含特殊字符的测试用例,我也能获得记录。

片段:

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