We start the server programmatically. For this, we have decided to use a Grizzly (https://javaee.github.io/grizzly/), which allows us to start the server using the configuration from Jersey's ResourceConfig (FQCN: org.glassfish.jersey.server.ResourceConfig), as shown in the test BooksEndpointTest (fragment).
The code can be found at https://bitbucket.org/vfarcic/tdd-java-alexandria:
public class BooksEndpointTest { public static final URI FULL_PATH = URI.create("http://localhost:8080/alexandria"); private HttpServer server; @Before public void setUp() throws IOException { ResourceConfig resourceConfig = new MyApplication(); server = GrizzlyHttpServerFactory .createHttpServer(FULL_PATH, resourceConfig); server.start(); ...