-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtestcontainers
Milestone
Description
Proposal
Goal is to simplify public interface of the WireMockContainer
class
Current methods
public String getEndpoint() {
return String.format("http://%s:%d", getHost(), getMappedPort(PORT));
}
public URI getRequestURI(String relativePath) throws URISyntaxException {
return new URI(getEndpoint() + "/" + relativePath);
}
Option 1
Align method names with WireMockServer class
public String baseUrl() {
return String.format("http://%s:%d", getHost(), getMappedPort(PORT));
}
public String url(String path) {
if (!path.startsWith("/")) {
path = "/" + path;
}
return baseUrl() + path;
}
Motivation
- Simplify switch from Embedded wiremock to Testcontainer
- Familiar api for developers
Option 2
public String getEndpoint() {
return String.format("http://%s:%d", getHost(), getMappedPort(PORT));
}
public String getEndpoint(String path) {
if (!path.startsWith("/")) {
path = "/" + path;
}
return getEndpoint() + path
}
Motivation
- Use Overloaded methods
getEndpoint
- naming consistency
- easier for developer to memorize and intuitively understand what method does
- Allow path to be with
/
and without it
- simplify switch from WireMockServer to WireMockTestcontainer
References
No response
oleg-nenashev
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtestcontainers