Skip to content

Commit

Permalink
[WFLY-18633][WFLY-19810] updates helloworld-rs wrt not deploying at r…
Browse files Browse the repository at this point in the history
…oot and parent changes
  • Loading branch information
emmartins committed Oct 31, 2024
1 parent de97aa6 commit 5bcd73e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
27 changes: 16 additions & 11 deletions helloworld-rs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Maintain separation between the artifact id and the version to help prevent
merge conflicts between commits changing the GA and those changing the V.
-->
<version>8</version>
<version>9</version>
<relativePath/>
</parent>
<artifactId>helloworld-rs</artifactId>
Expand All @@ -31,6 +31,8 @@
</licenses>

<properties>
<!-- the Maven project should use the minimum Java SE version supported -->
<maven.compiler.release>17</maven.compiler.release>
<!-- the version for the Server -->
<version.server>34.0.0.Final</version.server>
<!-- the versions for BOMs, Packs and Plugins -->
Expand Down Expand Up @@ -92,6 +94,8 @@
</dependencies>

<build>
<!-- Set the name of the WAR, used as the context root when the app is deployed. -->
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
Expand All @@ -115,11 +119,6 @@
<discover-provisioning-info>
<version>${version.server}</version>
</discover-provisioning-info>
<!--
Rename the output war to ROOT.war before adding it to the server, so that the
application is deployed in the root web context.
-->
<name>ROOT.war</name>
</configuration>
<executions>
<execution>
Expand All @@ -144,11 +143,6 @@
<version>${version.server}</version>
<context>cloud</context>
</discover-provisioning-info>
<!--
The parent POM's 'openshift' profile renames the output archive to ROOT.war so that the
application is deployed in the root web context. Add ROOT.war to the server.
-->
<filename>ROOT.war</filename>
</configuration>
<executions>
<execution>
Expand All @@ -158,6 +152,17 @@
</execution>
</executions>
</plugin>
<!-- do not attach sources to openshift deployments -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.MediaType;
import org.junit.After;
import org.junit.Before;
Expand All @@ -21,7 +20,7 @@
*/
public class RESTEndPointIT {
private Client client;
private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/helloworld-rs";
private static final String DEFAULT_SERVER_HOST = "http://localhost:8080";

private static String getServerHost() {
String serverHost = System.getenv("SERVER_HOST");
Expand All @@ -46,9 +45,9 @@ public void after() {

@Test
public void testRestEndPoint() {
WebTarget target = client.target(getServerHost())
.path("/rest/HelloWorld");
String responseMessage = target.request(MediaType.TEXT_PLAIN).get(String.class);
String responseMessage = client.target(getServerHost())
.path("helloworld-rs/rest/HelloWorld")
.request(MediaType.TEXT_PLAIN).get(String.class);
assertEquals("Hello World!", responseMessage);
}
}

0 comments on commit 5bcd73e

Please sign in to comment.