In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to test the rest interface of the LinkeyBPM application process development platform, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Testing method
Add the following parameters to the header of request:
Sysid
Syspwd
UserId
Test content
Take my to-do list interface as an example to test as follows: http://localhost:6677/master_dev/rest/task/pending
1. Use the interface tool to test using the SOAPUI Pro 5.1.2 interface test tool
2. Use Ajax to test
Call JS
Function ajaxtest () {var ajaxConfig = {url: 'rest/task/pending', type:' GET', data: {}, async: false, beforeSend: function (res) {res.setRequestHeader ('sysid',' SysAdmin') Res.setRequestHeader ('syspwd',' pass'); res.setRequestHeader ('userId',' admin'); / / res.setRequestHeader ('Content-Type', CONFIG.apiConfig.ContentType) }, success: function (res, status, xhr) {/ / if the callback function is empty, the data alert is returned directly ("successful call"); var data = res.data $('# showText') .val (JSON.stringify (data));}, error: function () {console.log ("ajax access error:");}} $.ajax (ajaxConfig);}
Calling effect
3. Use Java code to test
Test code
Import java.util.HashMap;import java.util.Map;import cn.linkey.factory.BeanCtx;import cn.linkey.rule.LinkeyRule;import cn.linkey.util.Tools;/** * @ RuleName:Process_ get my to-do list * @ author admin * @ Created: 2018-09-30 10:26:37 * / final public class R_SYSDEMO_BG02 implements LinkeyRule {private static final String sysid = "SysAdmin"; / / ID private static final String syspwd for business registration = "pass" / / access password private static final String userId = "admin"; / / specify user access private static final String url = "http://localhost:6677/master_dev/rest/task/pending";" @ Override public String run (HashMap params) throws Exception {/ / params is the parameter Map headerMap = new HashMap () passed in when running this rule; headerMap.put ("sysid", sysid); headerMap.put ("syspwd", syspwd) HeaderMap.put ("userId", userId); / / add business logic parameters StringBuilder param = new StringBuilder (); param.append ("? pageNo=1"); param.append ("& pageSize=10"); / / param.append ("& appId=1"); / / param.append ("& processId=1") / / param.append ("& processName=1"); / / param.append ("& keyWord=1"); String paramUrl = url + param.toString (); / / request data String responseStr = Tools.httpGet (paramUrl, headerMap, "") using Get method; / / print the returned data BeanCtx.p (responseStr) System.out.println ("print returned data:" + responseStr); return ";}}
Test effect
After reading the above, do you have any further understanding of how to test the rest interface of the LinkeyBPM application process development platform? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.