Skip to content

Commit

Permalink
Merge pull request #238 from kelnos/jersey-test-container-random-port
Browse files Browse the repository at this point in the history
Force the Grizzly Jersey test container to use a random port
  • Loading branch information
kelnos authored Apr 16, 2019
2 parents 80b437b + 1af29ab commit 569195b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package core.Dropwizard;

import helpers.JerseyTestHelpers;
import io.dropwizard.testing.junit.ResourceTestRule;
import multipartFormData.server.dropwizard.GuardrailJerseySupport;
import multipartFormData.server.dropwizard.definitions.Foo;
import multipartFormData.server.dropwizard.foo.FooHandler;
import multipartFormData.server.dropwizard.foo.FooResource;
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.test.TestProperties;
import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -23,7 +23,7 @@

public class DropwizardMultiPartTest {
static {
JerseyTestHelpers.setRandomJerseyTestContainerPort();
System.setProperty(TestProperties.CONTAINER_PORT, "0");
}

private static final FooHandler fooHandler = new FooHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import examples.server.dropwizard.user.UserHandler.GetUserByNameResponse;
import examples.server.dropwizard.user.UserHandler.LoginUserResponse;
import examples.server.dropwizard.user.UserResource;
import helpers.JerseyTestHelpers;
import io.dropwizard.testing.junit.ResourceTestRule;
import org.glassfish.jersey.test.TestProperties;
import org.glassfish.jersey.test.grizzly.GrizzlyTestContainerFactory;
import org.junit.Before;
import org.junit.ClassRule;
Expand All @@ -27,7 +27,7 @@

public class DropwizardResourceTest {
static {
JerseyTestHelpers.setRandomJerseyTestContainerPort();
System.setProperty(TestProperties.CONTAINER_PORT, "0");
}

private static final String USERNAME = "foobar";
Expand Down

This file was deleted.

0 comments on commit 569195b

Please sign in to comment.