arextest / arextest/arex-agent-java
[Bug] servlet multipart file record empty body cause replay error
- Dominant language
- Java
- Stars
- 564
- Forks
- 140
- Avg merge
- 36m
- Merged PRs (30d)
- 2
Description
### Search before asking
- [x] I have searched the existing [issues](https://github.com/arextest/arex-agent-java/issues) before asking.
### AREX Test Service
AREX Java Agent (arextest/arex-agent-java)
### Current Behavior
record in mongo, body is empty
```
{"body":"","attributes":{"RequestPath":"/api/service-hsp-sop/admin/file/upload","Headers":{"content-length":"10229","x-subject":"1","postman-token":"b7e1e95f-c17e-4aeb-b769-180c9c202a12","host":"localhost:8080","content-type":"multipart/form-data; boundary=--------------------------238665328374111326261843","connection":"keep-alive","cache-control":"no-cache","accept-encoding":"gzip, deflate, br","user-agent":"PostmanRuntime/7.45.0","accept":"*/*"},"configBatchNo":"1f98ba39-7da8-459d-8a81-c24e55156aef","HttpMethod":"POST"},"type":null}
```
### Expected Behavior
record body with file data
### Steps To Reproduce
1.use arex-java-agent to record this api
2.replay
3.replay get errors, the MultipartFile param(file) not passed in because the recorded body is empty in mongoDB
```
@Slf4j
@RequestMapping("/file")
public class AdminFileController {
@PostMapping("/upload")
public BaseResult upload(@RequestParam("file") MultipartFile file) {
// do something
}
}
```
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the AdminFileController.upload entry point and trace how the AREX Java Agent records and replays its MultipartFile request. Reproduce the upload, inspect the MongoDB record body, and verify that replay passes the recorded file data instead of an empty body.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb
- Domain
- api, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100