mallappa.mantur
04/15/2024, 11:18 AMTom
04/15/2024, 11:23 AMmatchesJsonPath
expressionTom
04/15/2024, 11:23 AM{
"name": {
"first": "Dave",
"last": "Minion!"
}
}
mallappa.mantur
04/15/2024, 12:06 PMmallappa.mantur
04/15/2024, 12:08 PMmallappa.mantur
04/15/2024, 12:10 PM<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-standalone</artifactId>
<!-- <version>3.4.2</version>-->
<version>3.0.0-beta-1</version>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-webhooks-extension</artifactId>
<version>2.30.0</version>
</dependency>
Tom
04/15/2024, 12:10 PMTom
04/15/2024, 12:11 PMmallappa.mantur
04/15/2024, 12:11 PMTom
04/15/2024, 12:12 PMmallappa.mantur
04/15/2024, 12:16 PMmallappa.mantur
04/15/2024, 12:16 PMmallappa.mantur
04/15/2024, 12:17 PMmallappa.mantur
04/15/2024, 12:17 PMmallappa.mantur
04/15/2024, 12:18 PMTom
04/15/2024, 12:18 PMTom
04/15/2024, 12:19 PMTom
04/15/2024, 12:19 PMmallappa.mantur
04/15/2024, 12:20 PMmallappa.mantur
04/15/2024, 12:21 PMTom
04/15/2024, 12:23 PMmallappa.mantur
04/15/2024, 12:24 PMTom
04/15/2024, 12:25 PMWireMockServer
or using the JUnit extension, in the wireMockConfig()
builder part add `.notifier(new ConsoleNotifier(true))`;mallappa.mantur
04/15/2024, 12:27 PMmallappa.mantur
04/15/2024, 12:30 PMmallappa.mantur
04/15/2024, 12:37 PMmallappa.mantur
04/15/2024, 12:37 PMTom
04/15/2024, 12:47 PMTom
04/15/2024, 12:48 PMmallappa.mantur
04/15/2024, 12:53 PMmallappa.mantur
04/15/2024, 12:53 PMmallappa.mantur
04/15/2024, 12:53 PM{
"name": "test"
}
mallappa.mantur
04/15/2024, 12:54 PMTom
04/15/2024, 12:55 PM{ "name": "te
Tom
04/15/2024, 12:56 PMTom
04/15/2024, 12:57 PMTom
04/15/2024, 12:57 PMmallappa.mantur
04/15/2024, 1:30 PMTom
04/15/2024, 1:32 PMmallappa.mantur
04/15/2024, 1:37 PMmallappa.mantur
04/15/2024, 1:38 PMTom
04/15/2024, 1:38 PMmallappa.mantur
04/15/2024, 1:39 PMTom
04/15/2024, 1:40 PM<http://localhost:8091>
in your case.mallappa.mantur
04/15/2024, 1:40 PMmallappa.mantur
04/15/2024, 1:41 PMmallappa.mantur
04/15/2024, 1:42 PMTom
04/15/2024, 1:43 PMmallappa.mantur
04/15/2024, 1:43 PMTom
04/15/2024, 1:44 PMmallappa.mantur
04/15/2024, 1:46 PMTom
04/15/2024, 1:46 PMTom
04/15/2024, 1:47 PMmallappa.mantur
04/15/2024, 1:47 PMTom
04/15/2024, 1:48 PMmallappa.mantur
04/15/2024, 1:50 PMmallappa.mantur
04/16/2024, 6:24 AMprivate Flux<String> getBodyFromReq(Flux<DataBuffer> flux) {
return flux.flatMap(dataBuffer -> {
byte[] bytes = new byte[dataBuffer.readableByteCount()];
dataBuffer.read(bytes);
DataBufferUtils.release(dataBuffer);
var body = new String(bytes, StandardCharsets.UTF_8);
return Mono.just(body);
});
}
2024-04-16 112223.450 Warning: JSON path expression '$[?(@.name == 'test')]' failed to match document '["{\r\n \"name\": \"t' because of error 'wiremock.net.minidev.json.parser.ParseException: Unexpected End Of File position 21: null'
2024-04-16 112223.450
Request was not matched
=======================
-----------------------------------------------------------------------------------------------------------------------
| Closest stub | Request |
-----------------------------------------------------------------------------------------------------------------------
|
POST | POST
[regex] | /boarding/paymentmethod/XXXX/merchantBoarding
/boarding/paymentmethod/([A-Z]{3,50})/merchantBoarding |
|
$[?(@.name == 'test')] | ["{\r\n \"name\": \"t <<<<< Body does not match
|
----------------------------------------------------------------------------------------------------------------------- what wire mock is expecting what type of object ? will that accept flux<String> . do you see this as a problem ?Tom
04/16/2024, 9:44 AMdataBuffer.readableByteCount()
isn’t returning the entire length of the JSON payload. I’m not all that familiar with the Spring reactive APIs but I’d guess there’s a way to read a DataBuffer
until it signals that everything has been read?