Manan Girdhar
01/30/2023, 9:26 AMSundar
01/30/2023, 11:57 AMSundar
01/30/2023, 11:57 AMSundar
01/30/2023, 11:57 AMSundar
01/31/2023, 5:33 AMSundar
01/31/2023, 5:37 AMwireMockServer.stubFor(post("/one")
.willReturn(ok())
.withPostServeAction("webhook", webhook()
.withMethod(POST)
.withUrl("<http://my-target-host/callback>")
.withHeader("Content-Type", "application/xml")
.withTransformers("xml/response/responsetest.xml")
.withBodyFile("xml/response/responsetest.xml"))
);
getting error on method ".withTransformers"Sundar
01/31/2023, 8:22 AMSundar
01/31/2023, 2:35 PMShruti Sagar Mishra
02/15/2023, 5:25 PMHashMap<ExecutionDataKeys, Object> executionStates = new HashMap<>();
WireMockServer wireMockServer = new WireMockServer(
new WireMockConfiguration().port(8080)
.notifier(new Slf4jNotifier(true))
);
wireMockServer.start();
ArrayList<String> hostNames = new ArrayList<>(
Arrays.asList(
"<https://host1.com>",
"<https://host2.com>",
));
hostNames.forEach(host->{
wireMockServer.stubFor(any(urlMatching(host+".*"))
.atPriority(10)
.willReturn(aResponse().proxiedFrom(host)));
});
I have also set proxy in emulator to localhost:8080. But it seems whitlisting is not working. all of my request are getting blocked.
P.S. I am trying to use appium along with wiremock to test state changes in application
[10:53 PM] I have already waster 3-4 days on this, and feeling kind exausted in this.
[10:53 PM] Please adviceOmkar Goulay
02/17/2023, 6:26 AMapplication/x-www-form-urlencoded
request?Sundar
02/17/2023, 6:38 AMAlbert Edlin Tan
02/23/2023, 7:56 AMAlbert Edlin Tan
02/23/2023, 7:56 AMAlbert Edlin Tan
02/23/2023, 7:59 AMAlbert Edlin Tan
02/23/2023, 7:59 AMAlbert Edlin Tan
02/23/2023, 7:59 AMAnitt Rajendran
02/27/2023, 9:41 PMAlessandro Bramati
03/02/2023, 9:52 AMwireMockConfiguration = options()
.disableRequestJournal()
.usingFilesUnderDirectory(rootFolder)
.port(Integer.parseInt(getProperty("port")))
.adminAuthenticator(getAdminAuthenticator())
.jettyAcceptors(Integer.parseInt(getPropertyOrDefault("acceptor.threads", DEFAULT_ACCEPTOR_THREADS)))
.keystorePath(getProperty("keystore.path"))
.keystorePassword(getProperty("keystore.password"))
.trustStorePath(getProperty("truststore.path"))
.trustStorePassword(getProperty("truststore.password"))
.extensions(
new AdminRequestLoggingFilter(),
new ServiceRequestLoggingFilter(),
new ServiceResponseLoggingFilter(),
new ResponseTemplateTransformer(true));
Here the error:
SL failure trying to make a proxied request from WireMock to ...
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
My keystore contains my private cert and the truststore contains the server certificate (everything ok with curl).
Is there something missing?
Thanks
AlessandroAaron
03/02/2023, 4:23 PMbasicAuth
keys support regex matching? https://stackoverflow.com/questions/75614289/wiremock-json-template-basicauth-and-doesnotmatch-not-working
I ran this locally and was getting the same error, even with switching to basicAuthCredentials
.Mukesh Bijalwan
03/03/2023, 1:09 PMSundar
03/08/2023, 12:10 PMYash Agarwal
03/14/2023, 9:56 AM"org.springframework.cloud:spring-cloud-starter-contract-stub-runner"
But I am getting the following error and not sure why. Any help ?
Request was not matched
=======================
-----------------------------------------------------------------------------------------------------------------------
| Closest stub | Request |
-----------------------------------------------------------------------------------------------------------------------
|
GET | GET
/ldap_directory_items/v2/group_members?key=key&name=APP-O | /ldap_directory_items/v2/group_members?key=key&name=APP-O
AUTH2-ABCD&size=100000 | AUTH2-ABCD&size=100000
|
|
-----------------------------------------------------------------------------------------------------------------------
Alex P
03/20/2023, 7:43 PMflag1[enabled]=true&transfer[destination]=target_account&metadata[userId]=1-2-3-4&metadata[sessionId]=a-b-c
I am having a hard time to use the values in the response. I am parsing the form via
{{formData request.body 'params' urlDecode=true}}
and I can see the values fine when doing
{{#each params}}
{{@index}} - {{@key}} - {{this}}
{{/each}}
But I cannot access the individual fields, no matter what I try, e.g.,
{{"metadata[userId]"}}
{{metadata\[userId\]}}
{{metadata.userId}}
My Google-fu also failed me 😕Alex P
03/21/2023, 8:39 AMassign
and a formData
expressions at the top of my response (referenced via bodyFileName
) and it seems that they get replaced by an empty line, i.e., I have a few empty lines before my JSON response body starts.
For now I just cram everything in one line and start the JSON object there, too, but it is really unreadable 😕
{{#assign 'a'}}...{{/assign}}{{#assign 'b'}}...{{/assign}}{{formData ...}}{
"id": ...
...
}
Is there a better way to suppress the empty lines in this case?Alex P
03/23/2023, 2:17 PM"request": {
"method": "POST",
"urlPattern": "/store|/v2/store",
"queryParameters": {
"client": {
"matches": "STORE-ABC-.+"
},
...
}
}
and the second looks like this
"request": {
"method": "POST",
"urlPattern": "/store|/v2/store",
"queryParameters": {
"client": {
"matches": "STORE-123-.+"
},
...
}
},
Both have additional but the same query parameters to match. Both also have different body patterns to match.
When I send this request (from WireMock's log)
POST /v2/store?client=STORE-123-12345&user=userId&realm=realm&key=sessionId
I see that WireMock only tries the other request (STORE-ABC) but fails because it cannot match some parts of the body patterns of STORE-ABC, even though STORE-123 would match.
So I wonder if WireMock even tries the STORE-123 mock because I cannot see it in the log.
More curiosly, at the very end I get a "closest stub" that is a completely different stub where of course neither URL nor body match; how come it shows this, and not for example the stubs it tried?Alex P
03/23/2023, 2:19 PMmappings
folder, e.g., by adding a disabled: true
field or so? 🤔Alex P
03/23/2023, 3:41 PMDELETE
endpoint, and I have a response bodyFileName
that has something like
{
"message": "Deleted {{arguments.count}} items"
}
And then I would have a stub like this
{
"request": ...,
"response": {
"bodyFileName": ...,
"arguments": {
"count": 1
}
...
}
Or can I use the metadata
for that? 🤔Alex P
03/23/2023, 4:34 PMAlex P
03/23/2023, 5:11 PMid
or name
in the response of __admin/requests/find
🤔
(Sorry for the bombardement of questions 😄 )Devaraj Rathinasamy
03/24/2023, 9:36 PMDevaraj Rathinasamy
03/24/2023, 9:36 PMTom
03/27/2023, 10:36 AMStubRequestFilter
extension class that removes the header prior to subsequent processing.Devaraj Rathinasamy
03/27/2023, 2:56 PM