Skip to content

Commit

Permalink
Fix integer format for hours
Browse files Browse the repository at this point in the history
  • Loading branch information
rbull-ch committed Feb 11, 2025
1 parent dd22bb6 commit 100552a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions issuer_gateway/api/healthcheck_finance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func TestUnitCheckScheduledMaintenance(t *testing.T) {
// Given
startHour := currentTime.Hour() - 2
endHour := startHour + 1
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%d00", startHour)
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%d00", endHour)
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%02d00", startHour)
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%02d00", endHour)
cfg.WeeklyMaintenanceDay = currentTime.Weekday()

// When
Expand All @@ -45,8 +45,8 @@ func TestUnitCheckScheduledMaintenance(t *testing.T) {
Convey("Current time is during weekly maintenance times", t, func() {
// Given
endHour := currentTime.Hour() + 1
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%d00", endHour)
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%02d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%02d00", endHour)
cfg.WeeklyMaintenanceDay = currentTime.Weekday()

// When
Expand All @@ -62,8 +62,8 @@ func TestUnitCheckScheduledMaintenance(t *testing.T) {
// Given
startHour := currentTime.Hour() + 1
endHour := currentTime.Hour() + 2
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%d00", startHour)
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%d00", endHour)
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%02d00", startHour)
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%02d00", endHour)
cfg.WeeklyMaintenanceDay = currentTime.Weekday()

// When
Expand Down Expand Up @@ -154,8 +154,8 @@ func TestUnitCheckScheduledMaintenance(t *testing.T) {
Convey("Current time is during scheduled maintenance times, planned ends later", t, func() {
// Given
weeklyEndHour := currentTime.Hour() + 1
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%d00", weeklyEndHour)
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%02d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%02d00", weeklyEndHour)
cfg.WeeklyMaintenanceDay = currentTime.Weekday()
plannedStartTime := currentTime.Add(time.Minute * -1).Truncate(time.Minute).Round(0)
cfg.PlannedMaintenanceStart = plannedStartTime.Format(time.RFC822)
Expand All @@ -174,8 +174,8 @@ func TestUnitCheckScheduledMaintenance(t *testing.T) {
Convey("Current time is during scheduled maintenance times, planned ends earlier", t, func() {
// Given
weeklyEndHour := currentTime.Hour() + 2
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%d00", weeklyEndHour)
cfg.WeeklyMaintenanceStartTime = fmt.Sprintf("%02d00", currentTime.Hour())
cfg.WeeklyMaintenanceEndTime = fmt.Sprintf("%02d00", weeklyEndHour)
cfg.WeeklyMaintenanceDay = currentTime.Weekday()
plannedStartTime := currentTime.Add(time.Hour * -1).Truncate(time.Minute).Round(0)
cfg.PlannedMaintenanceStart = plannedStartTime.Format(time.RFC822)
Expand Down

0 comments on commit 100552a

Please sign in to comment.