Tom
01/17/2023, 1:47 PMRuss Garratt
01/17/2023, 1:53 PMRuss Garratt
01/17/2023, 1:53 PMRuss Garratt
01/17/2023, 3:59 PMTom
01/17/2023, 4:00 PMRuss Garratt
01/17/2023, 4:00 PMRuss Garratt
01/17/2023, 4:00 PMRuss Garratt
01/17/2023, 4:04 PMTom
01/17/2023, 4:05 PMclient5
in its artifact name and packagesTom
01/17/2023, 4:06 PMRuss Garratt
01/17/2023, 4:07 PMTom
01/17/2023, 4:08 PMRuss Garratt
01/17/2023, 4:08 PMRuss Garratt
01/17/2023, 4:08 PMTom
01/17/2023, 4:09 PMRuss Garratt
01/17/2023, 4:10 PMTom
01/17/2023, 4:10 PMSinan Pehlivanoglu
01/17/2023, 5:43 PMNot listening on HTTP port. Either HTTP is not enabled or the WireMock server is stopped.
java.lang.IllegalStateException: Not listening on HTTP port. Either HTTP is not enabled or the WireMock server is stopped.
at wiremock.com.google.common.base.Preconditions.checkState(Preconditions.java:444)
at com.github.tomakehurst.wiremock.WireMockServer.port(WireMockServer.java:179)
Found this: https://github.com/bakdata/fluent-kafka-streams-tests/issues/22 and this: https://groups.google.com/g/wiremock-user/c/4kkOMn58CzM?pli=1
JUnit version 4.13.2
testImplementation "junit:junit:4.13.2"
Being going through the recently merged code to see what could have caused this in the past 24 hours but I can't quite tell.
private Environment newEnvironmentInstance(.....) {
.... some code here ....
final WireMockConfiguration config = wireMockConfig().dynamicPort();
final WireMockServer mockServer = new WireMockServer(config);
environment.setUrl(URI.create("<http://localhost>:" + mockServer.port()));
environment.setService(URI.create("<http://localhost>:" + mockServer.port()));
environment.setInitial(initial);
<http://logger.info|logger.info>("Environment started: {} on port {} ({})",
environment.getId(), mockServer.port(), environment.getName());
mockServer.start();
mockServer.stubFor(.....)
}
Any thoughts what might have caused this?Tom
01/17/2023, 5:54 PMmockServer.start()
before mockServer.port()
since when you use dynamically assigned ports they’re only assigned at startup.Sinan Pehlivanoglu
01/17/2023, 6:10 PMNeal Hawman
01/18/2023, 3:22 PMines rattab
01/19/2023, 7:51 AMclient_cacerts.jks is not a valid keystore
, although it is valid , here is the code
WireMockServer wireMock = new WireMockServer(wireMockConfig()
//.port(8080)
.httpsPort(8443)
.needClientAuth(true)
.keystoreType("jks")
.keystorePath("client_keystore.jks") // Either a path to a file or a resource on the classpath
.keystorePassword("secret")
.keyManagerPassword("secret")
.trustStorePath("client_cacerts.jks")// The password used to access the keystore. Defaults to "password" if omitted
.trustStorePassword("secret")
);
@Test
void test() {
wireMock.start();
wireMock.stubFor(
WireMock.get("/hello")
.willReturn(WireMock.ok("world"))
);
Any thoughts what might be causing this error ?Sinan Pehlivanoglu
01/19/2023, 4:24 PMRequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.StubRequestHandler. Normalized mapped under returned 'null'
Could someone explain what this means? Seeing it in our logs while trying to debug somethingSofia Pacifico
01/19/2023, 5:59 PMTom
01/19/2023, 7:34 PMDeepak Shakya
01/20/2023, 8:46 AM/endpoint/customers/abc123
/endpoint/customers/abc456
For requests that come for the above paths (/endpoint/customers/abc\d+
), I want the mocks to be used. For anything else, it can routed to the proxy. Here is how I am trying to configure the proxy.
{
"request": {
"method": "ANY",
"urlPattern": "/endpoint/customers/(?!abc\\d+)"
},
"response": {
"proxyBaseUrl": "<http://real-customer-endpoint/api>",
"proxyUrlPrefixToRemove": "/endpoint"
}
}
But this doesn't seem to work. Am I missing something or this is not possible?
Also, what are your thoughts on having the inverse filters likes urlPatternNotMatching and urlPathPatternNotMatching as I suggested them here - https://github.com/wiremock/wiremock/issues/2068Alessandro Bramati
01/20/2023, 9:54 AMPavel Serada
01/20/2023, 5:15 PM{{{jsonPath request.body '$..paths[1].source'}}}
{
"request": {
"urlPattern": ".*/transfers",
"method": "POST"
},
"response": {
"status": 200,
"body": "{\"id\": \"{{{jsonPath request.body '$..paths[1].source'}}}\",
Request is a valid Json structure containing this part in its body, and I need to get blablablah2 from request body to return it in response body:
{
"paths": [
{
"source": "blablablah1",
"destination": "blablablah1"
},
{
"source": "blablablah2",
"destination": "blablablah2"
}
]
}
My issue is that Wiremock returns: "body": "{\"id\": \"[\"*blablablah2*\"]\",
and I'd like to get it without [ ]
, any idea why it's happening?
Actual: "body": "{\"id\": \"[\"*blablablah2*\"]\",
Expected: "body": "{\"id\": \"*blablablah2*\",
Joaquin Penalver
01/24/2023, 9:12 AMJoaquin Penalver
01/24/2023, 9:14 AMwiremock | Exception in thread "main" joptsimple.UnrecognizedOptionException: https-port is not a recognized option