[JAVA-31067] Fix integration jdk17 jersey tests: Assign random/available port to jersey server (#16135)
This commit is contained in:
parent
68db1db5f0
commit
be47444fcb
|
@ -104,7 +104,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<jersey.version>3.1.1</jersey.version>
|
||||
<jersey.version>3.1.5</jersey.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -41,6 +41,7 @@ public class StocksResourceIntegrationTest extends JerseyTest {
|
|||
resourceConfig.register(IllegalArgumentExceptionMapper.class);
|
||||
resourceConfig.register(ServerExceptionMapper.class);
|
||||
resourceConfig.packages("com.baeldung.jersey.exceptionhandling.rest");
|
||||
forceSet(TestProperties.CONTAINER_PORT, "0");
|
||||
return resourceConfig;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import static org.junit.Assert.assertEquals;
|
|||
|
||||
import org.glassfish.jersey.server.ResourceConfig;
|
||||
import org.glassfish.jersey.test.JerseyTest;
|
||||
import org.glassfish.jersey.test.TestProperties;
|
||||
import org.junit.Test;
|
||||
|
||||
import jakarta.ws.rs.core.Application;
|
||||
|
@ -15,6 +16,7 @@ public class GreetingsResourceIntegrationTest extends JerseyTest {
|
|||
|
||||
@Override
|
||||
protected Application configure() {
|
||||
forceSet(TestProperties.CONTAINER_PORT, "0");
|
||||
return new ResourceConfig(Greetings.class);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue