Skip to content

Commit

Permalink
Align ejb-txn-remote-call default server host with the others
Browse files Browse the repository at this point in the history
  • Loading branch information
kabir committed Jan 9, 2024
1 parent 36be222 commit 281ba2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
*/
public class BasicRuntimeIT {

private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/";
private static final String DEFAULT_APPLICATION = "client";
private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/client";

@Test
public void testHTTPEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException {
Expand All @@ -46,17 +45,17 @@ public void testHTTPEndpointIsAvailable() throws IOException, InterruptedExcepti
if (serverHost == null) {
serverHost = DEFAULT_SERVER_HOST;
}
testEndpoint(serverHost, DEFAULT_APPLICATION,"/remote-outbound-stateless",200);
testEndpoint(serverHost, DEFAULT_APPLICATION,"/remote-outbound-notx-stateless",200);
testEndpoint(serverHost, DEFAULT_APPLICATION,"/direct-stateless",200);
testEndpoint(serverHost, DEFAULT_APPLICATION,"/direct-stateless-http",200);
testEndpoint(serverHost, DEFAULT_APPLICATION,"/remote-outbound-notx-stateful",200);
testEndpoint(serverHost, DEFAULT_APPLICATION,"/remote-outbound-fail-stateless",200);
testEndpoint(serverHost, "/remote-outbound-stateless",200);
testEndpoint(serverHost, "/remote-outbound-notx-stateless",200);
testEndpoint(serverHost, "/direct-stateless",200);
testEndpoint(serverHost, "/direct-stateless-http",200);
testEndpoint(serverHost, "/remote-outbound-notx-stateful",200);
testEndpoint(serverHost, "/remote-outbound-fail-stateless",200);
}

private void testEndpoint(String serverHost, String application, String endpoint, int expectedCode) throws URISyntaxException, IOException, InterruptedException {
private void testEndpoint(String serverHost, String endpoint, int expectedCode) throws URISyntaxException, IOException, InterruptedException {
final HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(serverHost + application + endpoint))
.uri(new URI(serverHost + endpoint))
.GET()
.build();
final HttpClient client = HttpClient.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
*/
public class BasicRuntimeIT {

private static final String DEFAULT_SERVER_HOST = "http://localhost:8180/";
private static final String DEFAULT_APPLICATION = "server";
private static final String DEFAULT_SERVER_HOST = "http://localhost:8180/server";

@Test
public void testHTTPEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException {
Expand All @@ -46,12 +45,12 @@ public void testHTTPEndpointIsAvailable() throws IOException, InterruptedExcepti
if (serverHost == null) {
serverHost = DEFAULT_SERVER_HOST;
}
testEndpoint(serverHost, DEFAULT_APPLICATION,"/commits",200);
testEndpoint(serverHost, "/commits",200);
}

private void testEndpoint(String serverHost, String application, String endpoint, int expectedCode) throws URISyntaxException, IOException, InterruptedException {
private void testEndpoint(String serverHost, String endpoint, int expectedCode) throws URISyntaxException, IOException, InterruptedException {
final HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(serverHost + application + endpoint))
.uri(new URI(serverHost + endpoint))
.GET()
.build();
final HttpClient client = HttpClient.newBuilder()
Expand Down

0 comments on commit 281ba2f

Please sign in to comment.