I have been using wiremock these days. And when I used my own class as the request body in stubFor(), it didn't work.
Here are the details: 1. Using stubFor() building the wiremock. MyBinaryEqualToPattern is the class I wrote extending wiremock's BinaryEqualToPattern.
stubFor(put(urlEqualTo("***"))
.withRequestBody(new MyBinaryEqualToPattern(body))
.willReturn(aResponse()
.withStatus(200)
.withBody("OK")
)
);
2.Then I debug into this statement, I found that when building the request body, it would run into a transform method and said something related to java.util.propertyPermission. It seems it cannot use my own class. Then the request body was set null and everything fail. Did anybody know what's going on?
You can find detailed code here
Aucun commentaire:
Enregistrer un commentaire