BackupServletV2 { @GET @Path("/do_snapshot") public Response backup() throws Exception { snapshotMetaService.execute(); return Response.ok(REST_SUCCESS, MediaType.APPLICATION_JSON).build(); } @Inject  BackupServletV2(
            IBackupStatusMgr backupStatusMgr,
            BackupVerification backupVerification,
            SnapshotMetaTask snapshotMetaService,
            BackupTTLTask backupTTLService,
            IConfiguration configuration,
            IFileSystemContext backupFileSystemCtx,
            @Named("v2") IMetaProxy metaV2Proxy,
            Provider<AbstractBackupPath> pathProvider,
            BackupV2Service backupService); @GET @Path("/do_snapshot") Response backup(); @GET @Path("/ttl") Response ttl(); @GET @Path("/clearCache") Response clearCache(); @GET @Path("/updateService") Response updateService(); @GET @Path("/info/{date}") Response info(@PathParam("date") String date); @GET @Path("/validate/{daterange}") Response validateV2SnapshotByDate(
            @PathParam("daterange") String daterange,
            @DefaultValue("false") @QueryParam("force") boolean force); @GET @Path("/list/{daterange}") Response list(@PathParam("daterange") String daterange);  }
@Test public void testBackup() throws Exception { new Expectations() { { snapshotBackup.execute(); } }; Response response = resource.backup(); assertEquals(200, response.getStatus()); assertEquals("[\"ok\"]", response.getEntity()); assertEquals( MediaType.APPLICATION_JSON_TYPE, response.getMetadata().get("Content-Type").get(0)); }