cancel
Showing results for 
Search instead for 
Did you mean: 

[SoapUI 5.6.0] mockRequest is NULL for PATCH call in REST Mock

Highlighted
New Contributor

[SoapUI 5.6.0] mockRequest is NULL for PATCH call in REST Mock

I currently have mock services setup for a few different methods (GET, POST, PATCH). I am trying to build dynamic responses via the Script option and have this working successfully for my GET and POST calls, however I am unable to get my PATCH call working in this way and I'm wondering if this is a limitation of the software.

 

At present the only script applied on the PATCH /orderMetadata data call is to try and capture the request body...

 

// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody

 

I have the following OnRequest scripts running on the solution as per the screen shot below however I cannot capture the request body being passed in

 

log.info(mockRequest.getRequestContent())
log.info(mockRequest.getPath())

 

Below shows the log script log for a POST /orderMetadata call and a PATCH /orderMetadata call both called with the same request body, the POST is working successfully (note - this has the same script applied as the PATCH) whereas the PATCH is null. Is this an issue with using PATCH? Are there any other commands that would capture the request body so I can branch on this? 

 

Note - I have tried renaming the PATCH /orderMetadata call to differentiate it from the POST but this made no difference

 

Thanks

 

martinh3345_0-1603985668316.png

 

New Here?
Join us and watch the welcome video:
Top Kudoed Authors