Boost Spring Boot API Testing with the Free Open‑Source Cool Request Plugin
The article introduces Cool Request, a free open‑source IntelliJ IDEA plugin that streamlines Spring Boot backend API testing by providing in‑IDE request execution, method timing statistics, interceptor bypass, job triggering, Java pre/post scripts, response preview, and export to third‑party tools, complete with usage examples and code snippets.
Introduction
When developing Spring Boot back‑ends, developers often need an API testing tool. While tools like Postman are common, the most convenient approach is to test directly inside IntelliJ IDEA using a plugin that can analyze controller definitions and issue HTTP requests without leaving the IDE.
The article recommends Cool Request , a free and open‑source IDEA plugin designed for this purpose.
Plugin name: Cool Request GitHub: https://github.com/houxinlin/cool-request Documentation: plugin.houxinlin.com Purpose: Simplify Spring Boot backend interface debugging. Installation: Search “Cool Request” in the IDEA plugin marketplace.
Key Features
Method Execution Timing Statistics
Cool Request uniquely offers trace‑based timing statistics for any package except the Java core packages. When enabled, the plugin automatically tracks method calls starting from the controller. Depth levels control how deep the tracing goes (controller only, controller → service, etc.). Users can manually add methods to the trace if static analysis cannot resolve them.
The UI shows a "+100" indicator next to a method, meaning the method was invoked 100 times during the trace, though individual method durations are not displayed. Methods exceeding a configurable threshold (e.g., 5 ms) are highlighted in red.
Bypass Interceptors and Filters
For endpoints protected by authentication, Cool Request can send a request that skips interceptors and filters, allowing direct access to the controller method. This is useful when a token has expired and re‑login is inconvenient.
Trigger Scheduled Jobs and XXL‑Job
The plugin can manually trigger long‑running scheduled tasks or XXL‑Job jobs with a single click, optionally passing parameters, and also supports Spring’s built‑in scheduler annotations.
Java Pre‑ and Post‑Execution Scripts
Cool Request is the only IDEA plugin that supports custom Java scripts before and after a request. Scripts can create UI windows, call third‑party libraries, or use Spring Boot utilities. Example: extracting a token from a JSON response and storing it as a global request header.
public void handlerResponse(ILog log, HTTPResponse response, IEnv env) {
env.getCurrentEnv().setEnvHeader("Authorization", response.getIfJSONBody().getKey("data").toString());
}Alternatively, using FastJSON to parse the response body:
public void handlerResponse(ILog log, HTTPResponse response, IEnv env) {
String body = new String(response.getResponseBody());
log.println(body);
User user = JSON.parseObject(body, User.class);
log.println(user.getAge() + "");
}Debugging in the Code Editor
Requests can be opened in a new tab via the “Open in a new tab” action, preserving the parameters from the previous execution.
Export to Third‑Party Tools
Cool Request integrates with Apifox and Apipost for one‑click export, and also supports exporting the definition as an OpenAPI specification.
Multiple Icons and Language Switch
The plugin offers two icon themes and a Chinese/English toggle to suit different user preferences.
Response Preview
Five response formats are automatically detected and rendered: JSON, text, image, HTML, and XML.
Conclusion
Cool Request provides a comprehensive set of features that significantly improve the convenience of debugging Spring Boot APIs directly within IntelliJ IDEA, making it a valuable tool for backend developers.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
