UtilHandler { @GET @Path("/getReleaseInfo") @Produces(APPLICATION_JSON) public ReleaseInfo getReleaseInfo() { return versionManager.getRemoteReleaseInfo(); } @Inject  UtilHandler(final VersionManager versionManager); @GET @Path("/getVersion") @Produces(TEXT_PLAIN) String getVersion(); @GET @Path("/getReleaseInfo") @Produces(APPLICATION_JSON) ReleaseInfo getReleaseInfo(); @POST @Path("/getChildFolders") @Produces(APPLICATION_JSON) Collection<Folder> getChildFolders(@FormParam("path") final String parentPath);  }
@Test public void testGetReleaseInfo() { VersionManager versionManager = createMock(VersionManager.class); expect(versionManager.getRemoteReleaseInfo()).andReturn(new ReleaseInfo("name", true, "url")); replay(versionManager); UtilHandler utilHandler = new UtilHandler(versionManager); ReleaseInfo releaseInfo = utilHandler.getReleaseInfo(); assertNotNull(releaseInfo); verify(versionManager); }