RepairRunStatus { public String getDuration() { return duration; } RepairRunStatus();  RepairRunStatus(
      UUID runId,
      String clusterName,
      String keyspaceName,
      Collection<String> columnFamilies,
      int segmentsRepaired,
      int totalSegments,
      RepairRun.RunState state,
      DateTime startTime,
      DateTime endTime,
      String cause,
      String owner,
      String lastEvent,
      DateTime creationTime,
      DateTime pauseTime,
      double intensity,
      boolean incrementalRepair,
      RepairParallelism repairParallelism,
      Collection<String> nodes,
      Collection<String> datacenters,
      Collection<String> blacklistedTables,
      int repairThreadCount,
      UUID repairUnitId);  RepairRunStatus(RepairRun repairRun, RepairUnit repairUnit, int segmentsRepaired); @JsonProperty("creation_time") String getCreationTimeIso8601(); @JsonProperty("creation_time") void setCreationTimeIso8601(String dateStr); @JsonProperty("start_time") String getStartTimeIso8601(); @JsonProperty("start_time") void setStartTimeIso8601(String dateStr); @JsonProperty("end_time") String getEndTimeIso8601(); @JsonProperty("end_time") void setEndTimeIso8601(String dateStr); @JsonProperty("pause_time") String getPauseTimeIso8601(); @JsonProperty("pause_time") void setPauseTimeIso8601(String dateStr); @JsonProperty("current_time") void setCurrentTimeIso8601(String dateStr); @JsonProperty("current_time") String getCurrentTimeIso8601(); String getCause(); void setCause(String cause); String getOwner(); void setOwner(String owner); UUID getId(); void setId(UUID id); String getClusterName(); void setClusterName(String clusterName); Collection<String> getColumnFamilies(); void setColumnFamilies(Collection<String> columnFamilies); String getKeyspaceName(); void setKeyspaceName(String keyspaceName); RepairRun.RunState getState(); void setState(RepairRun.RunState runState); DateTime getCreationTime(); void setCreationTime(DateTime creationTime); DateTime getStartTime(); void setStartTime(DateTime startTime); DateTime getEndTime(); void setEndTime(DateTime endTime); DateTime getPauseTime(); void setPauseTime(DateTime pauseTime); DateTime getCurrentTime(); void setCurrentTime(DateTime currentTime); double getIntensity(); void setIntensity(double intensity); boolean getIncrementalRepair(); void setIncrementalRepair(boolean incrementalRepair); int getTotalSegments(); void setTotalSegments(int segmentCount); RepairParallelism getRepairParallelism(); void setRepairParallelism(RepairParallelism repairParallelism); int getSegmentsRepaired(); void setSegmentsRepaired(int segmentsRepaired); String getLastEvent(); void setLastEvent(String lastEvent); String getDuration(); void setDuration(String duration); @JsonProperty("estimated_time_of_arrival") String getEstimatedTimeOfArrivalIso8601(); @JsonProperty("estimated_time_of_arrival") void setEstimatedTimeOfArrivalIso8601(String dateStr); Collection<String> getNodes(); void setNodes(Collection<String> nodes); Collection<String> getDatacenters(); void setDatacenters(Collection<String> datacenters); @JsonProperty("blacklisted_tables") Collection<String> getBlacklistedTables(); void setBlacklistedTables(Collection<String> blacklistedTables); int getRepairThreadCount(); void setRepairThreadCount(int repairThreadCount); @Nullable static String dateTimeToIso8601(@Nullable DateTime dateTime); UUID getRepairUnitId(); void setRepairUnitId(UUID repairUnitId);  }
@Test public void testRunningRepairDuration() { RepairRunStatus repairStatus = new RepairRunStatus( UUID.randomUUID(), "test", "test", Collections.EMPTY_LIST, 10, 100, RepairRun.RunState.RUNNING, new DateTime().now().minusMinutes(1), null, "test", "alex", "", new DateTime(2018, 4, 11, 15, 00, 00, DateTimeZone.UTC), null, 0.9, false, RepairParallelism.PARALLEL, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, 1, UUID.randomUUID()); assertEquals("1 minute 0 seconds", repairStatus.getDuration()); }
@Test public void testFinishedRepairDuration() { RepairRunStatus repairStatus = new RepairRunStatus( UUID.randomUUID(), "test", "test", Collections.EMPTY_LIST, 10, 100, RepairRun.RunState.DONE, new DateTime().now().minusMinutes(1).minusSeconds(30), new DateTime().now(), "test", "alex", "", new DateTime(2018, 4, 11, 15, 00, 00, DateTimeZone.UTC), null, 0.9, false, RepairParallelism.PARALLEL, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, 1, UUID.randomUUID()); assertEquals("1 minute 30 seconds", repairStatus.getDuration()); }
@Test public void testPausedRepairDuration() { RepairRunStatus repairStatus = new RepairRunStatus( UUID.randomUUID(), "test", "test", Collections.EMPTY_LIST, 10, 100, RepairRun.RunState.PAUSED, new DateTime().now().minusMinutes(1).minusSeconds(50), new DateTime().now(), "test", "alex", "", new DateTime(2018, 4, 11, 15, 00, 00, DateTimeZone.UTC), new DateTime().now().minusMinutes(1), 0.9, false, RepairParallelism.PARALLEL, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, 1, UUID.randomUUID()); assertEquals("1 minute 50 seconds", repairStatus.getDuration()); }
@Test public void testAbortedRepairDuration() { RepairRunStatus repairStatus = new RepairRunStatus( UUID.randomUUID(), "test", "test", Collections.EMPTY_LIST, 10, 100, RepairRun.RunState.ABORTED, DateTime.now().minusMinutes(1).minusSeconds(30), DateTime.now(), "test", "alex", "", new DateTime(2018, 4, 11, 15, 00, 00, DateTimeZone.UTC), new DateTime().now().minusMinutes(1), 0.9, false, RepairParallelism.PARALLEL, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, 1, UUID.randomUUID()); assertEquals("1 minute 30 seconds", repairStatus.getDuration()); }