}
@Before
public void init() {
this.port = (int)((new Random().nextDouble() * 4000) + 1000);
ResteasyCdiExtension cdiExtension = CDI.current().select(ResteasyCdiExtension.class).get();
CdiNettyJaxrsServer netty = new CdiNettyJaxrsServer();
ResteasyDeployment rd = new ResteasyDeployment();
rd.setActualResourceClasses(cdiExtension.getResources());
rd.setInjectorFactoryClass(CdiInjectorFactory.class.getName());
rd.getActualProviderClasses().addAll(cdiExtension.getProviders());
netty.setDeployment(rd);
netty.setPort(port);
netty.setRootResourcePath("/api");
netty.start();
this.server = netty;