This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The idea is to launch an in-memory HTTP server. Jersey has several extensions so you can use Grizzly or GlassFish. But a very simple test would be to just use the that comes with the Oracle JDK. As you can see in line 11, the only thing we need to do is to attach a with the JAX-RS application configuration (class ApplicationConfig not shown here, but you can download the code ). Then you just need to start the in memory web server (();), check your valid (return code 200) and invalid (return code 404) URIs and stop the server. That’s it.