-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WireMock config changes are taken into account for live-reload (dev mode only) #85
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
package io.quarkiverse.wiremock.devservice; | ||
|
||
import static io.quarkiverse.wiremock.devservice.ConfigProviderResource.BASE_URL; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.eclipse.microprofile.config.ConfigProvider; | ||
|
||
@Path("/quarkus/wiremock") | ||
@Path(BASE_URL) | ||
@ApplicationScoped | ||
class ConfigProviderResource { | ||
|
||
@Path("/devservices/config") | ||
static final String BASE_URL = "/quarkus/wiremock/devservices"; | ||
|
||
@GET | ||
@Path("/reload") | ||
public Response reload() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be added to the docs too, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I don't get your point. It's just an endpoint for testing purposes. What's your intention to add this to the doc? |
||
return Response.ok().build(); | ||
} | ||
|
||
@GET | ||
@Path("/config") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String getConfigValue(@QueryParam("name") String propertyName) { | ||
public String getConfigValue(@QueryParam("propertyName") String propertyName) { | ||
return ConfigProvider.getConfig().getValue(propertyName, String.class); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"url": "/wiremock" | ||
"url": "/basic" | ||
}, | ||
"response": { | ||
"status": 200, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://quarkus.io/guides/all-builditems , HotDeploymentWatchedFileBuildItem actually supports passing a Glob pattern, hence you could probably instruct it to watch all files under the Mappings and Files directories (including when new ones added?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've analyzed the
glob-pattern
feature back in the days. However, it does not convince me since the API is not very intuitive. Furthermore, it also doesn't work for new files (please see quarkusio/quarkus#25338). Anyway, the current implementation already watches all files under the Mappings and Files directories.