Skip to content

Commit

Permalink
fix: set most reasonable defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
chberger committed Nov 14, 2023
1 parent eb22567 commit 44a6aad
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface WireMockServerConfig {
* Indicates whether WireMock server needs to be restarted after Quarkus live reload (see development mode for more
* information) or not.
*/
@WithDefault("false")
@WithDefault("true")
boolean reload();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.restassured.RestAssured;

// Write your dev mode tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-hot-reload for more information
@SuppressWarnings("java:S5786")
public class WireMockDevModeTest {
private static final int DEV_MODE_PORT = 9099;
private static final int DEV_MODE_PORT_MODIFIED = 9100;
Expand All @@ -28,10 +29,9 @@ public class WireMockDevModeTest {
.addAsResource(APP_PROPERTIES));

@Test
public void testPortMappingViaLiveReload() {
void testPortMappingViaLiveReload() {
assertTrue(isPortInUse(DEV_MODE_PORT), "WireMock DevService doesn't listen on port " + DEV_MODE_PORT);

RestAssured.get(BASE_URL + "/reload").then().body(equalTo("true"));
DEV_MODE_TEST.modifyResourceFile(APP_PROPERTIES,
s -> s.replace("devservices.port=" + DEV_MODE_PORT, "devservices.port=" + DEV_MODE_PORT_MODIFIED));

Expand Down
1 change: 0 additions & 1 deletion deployment/src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
%dev.quarkus.wiremock.devservices.reload=true
# The short form notation leads to a warning that the property 'quarkus.wiremock.devservices.port' is unknown. This is most likely a bug Quarkus and should be reported upstream.
#%dev,test.quarkus.wiremock.devservices.port=9099
%dev.quarkus.wiremock.devservices.port=9099
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/includes/quarkus-wiremock.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_WIREMOCK_DEVSERVICES_RELOAD+++`
endif::add-copy-button-to-env-var[]
--|boolean
|`false`
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-wiremock_quarkus.wiremock.devservices.files-mapping]]`link:#quarkus-wiremock_quarkus.wiremock.devservices.files-mapping[quarkus.wiremock.devservices.files-mapping]`

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Example (default) configuration for testing and local development:
[source,properties]
----
%dev,test.quarkus.wiremock.devservices.enabled=true
%dev,test.quarkus.wiremock.devservices.reload=false
%dev,test.quarkus.wiremock.devservices.reload=true
%dev,test.quarkus.wiremock.devservices.files-mapping=src/test/resources
%dev,test.quarkus.wiremock.devservices.port=8089
%dev,test.quarkus.wiremock.devservices.global-response-templating=false
Expand Down

0 comments on commit 44a6aad

Please sign in to comment.