Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Delbrueck committed Sep 14, 2023
1 parent 7dda66c commit ed13016
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ public class CalculatorResource implements QuarkusTestResourceLifecycleManager,
.withClasspathResourceMapping("wiremock", "/home/wiremock", BindMode.READ_ONLY)
.withExposedPorts(8080);
private Map<String, String> initArgs;
private Optional<String> containerNetworkId;
private Optional<String> containerNetworkId = Optional.empty();

public static void main(String[] args) {
new CalculatorResource().start();
public static void main(String[] args) throws InterruptedException {
CalculatorResource resource = new CalculatorResource();
resource.start();
Thread.sleep(3600 * 1000);
}

@Override
Expand All @@ -42,8 +44,10 @@ public Map<String, String> start() {
.withHeader("Content-Type", WireMock.containing("application/soap+xml"))
.willReturn(aResponse().withBodyFile("bigdata.xml").withHeader("Content-Type", "application/soap+xml;charset=UTF-8")));

if (Boolean.parseBoolean(initArgs.get("Local"))) {
return Map.of("calculator.url", "http://%s:%d".formatted(container.getHost(), container.getFirstMappedPort()));
if (initArgs == null || Boolean.parseBoolean(initArgs.get("Local"))) {
String url = "http://%s:%d".formatted(container.getHost(), container.getFirstMappedPort());
System.out.println("URL: %s".formatted(url));
return Map.of("calculator.url", url);
} else {
return Map.of("calculator.url", "http://%s:%d".formatted("wiremock", 8080));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MyManualTest {
public void testManually() throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.build();
HttpRequest request = HttpRequest.newBuilder(URI.create("http://localhost:8185/rs/cxf"))
HttpRequest request = HttpRequest.newBuilder(URI.create("http://localhost:8185/rs/cxf?requests=10"))
.POST(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application-manual.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
calculator.url=http://localhost:8187/ws/calculator
calculator.url=http://localhost:32874

0 comments on commit ed13016

Please sign in to comment.