@Test public void testBackUpInfoNoBackups() { new Expectations() { { backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateUtil.DateRange((Instant) any, (Instant) any)); result = new ArrayList<>(); } }; Response response = resource.info(backupDate); assertEquals(200, response.getStatus()); assertEquals( GsonJsonSerializer.getGson().toJson(new ArrayList<>()), response.getEntity().toString()); }
@GET @Path("/info/{date}") public Response info(@PathParam("date") String date) { Instant instant = DateUtil.parseInstant(date); List<BackupMetadata> metadataList = backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateRange( instant, instant.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS))); return Response.ok(GsonJsonSerializer.getGson().toJson(metadataList)).build(); }
BackupServletV2 { @GET @Path("/info/{date}") public Response info(@PathParam("date") String date) { Instant instant = DateUtil.parseInstant(date); List<BackupMetadata> metadataList = backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateRange( instant, instant.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS))); return Response.ok(GsonJsonSerializer.getGson().toJson(metadataList)).build(); } }
BackupServletV2 { @GET @Path("/info/{date}") public Response info(@PathParam("date") String date) { Instant instant = DateUtil.parseInstant(date); List<BackupMetadata> metadataList = backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateRange( instant, instant.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS))); return Response.ok(GsonJsonSerializer.getGson().toJson(metadataList)).build(); } @Inject  BackupServletV2(
            IBackupStatusMgr backupStatusMgr,
            BackupVerification backupVerification,
            SnapshotMetaTask snapshotMetaService,
            BackupTTLTask backupTTLService,
            IConfiguration configuration,
            IFileSystemContext backupFileSystemCtx,
            @Named("v2") IMetaProxy metaV2Proxy,
            Provider<AbstractBackupPath> pathProvider,
            BackupV2Service backupService); }
BackupServletV2 { @GET @Path("/info/{date}") public Response info(@PathParam("date") String date) { Instant instant = DateUtil.parseInstant(date); List<BackupMetadata> metadataList = backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateRange( instant, instant.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS))); return Response.ok(GsonJsonSerializer.getGson().toJson(metadataList)).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); }
BackupServletV2 { @GET @Path("/info/{date}") public Response info(@PathParam("date") String date) { Instant instant = DateUtil.parseInstant(date); List<BackupMetadata> metadataList = backupStatusMgr.getLatestBackupMetadata( BackupVersion.SNAPSHOT_META_SERVICE, new DateRange( instant, instant.plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS))); return Response.ok(GsonJsonSerializer.getGson().toJson(metadataList)).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);  }