- final ResourceConfig rc = new ResourceConfig(TestRestClientEndpoint.class);
- server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
+ if (NetworkUtil.isTcpPortOpen("localHost", PORT, 3, 50L)) {
+ throw new IllegalStateException("port " + PORT + " is still in use");
+ }
+
+ server = HttpServletServerFactoryInstance.getServerFactory().build(
+ "TestExecutionPropertyRest", false, null, PORT, "/TestExecutionRest", false, false);
+
+ server.addServletClass(null, TestRestClientEndpoint.class.getName());
+ server.setSerializationProvider(GsonMessageBodyHandler.class.getName());