Skip to content

Commit

Permalink
APIGOV-28410 change func name
Browse files Browse the repository at this point in the history
  • Loading branch information
alrosca committed Sep 20, 2024
1 parent 7d3de57 commit 7120f70
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/transaction/metric/metricscollector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
traceStatus = healthcheck.OK
)

func getYesterdayTime() time.Time {
func getFutureTime() time.Time {
return time.Now().Add(10 * time.Minute)
}

Expand Down Expand Up @@ -633,7 +633,7 @@ func TestMetricCollectorUsageAggregation(t *testing.T) {
myCollector := createMetricCollector()
metricCollector := myCollector.(*collector)
metricCollector.usagePublisher.schedule = "* * * * *"
metricCollector.usagePublisher.report.currTimeFunc = getYesterdayTime
metricCollector.usagePublisher.report.currTimeFunc = getFutureTime

mockReports := generateMockReports(test.transactionsPerReport)
b, _ := json.Marshal(mockReports)
Expand Down Expand Up @@ -688,7 +688,7 @@ func TestMetricCollectorCache(t *testing.T) {
myCollector := createMetricCollector()
metricCollector := myCollector.(*collector)
metricCollector.usagePublisher.schedule = "* * * * *"
metricCollector.usagePublisher.report.currTimeFunc = getYesterdayTime
metricCollector.usagePublisher.report.currTimeFunc = getFutureTime

metricCollector.AddMetric(apiDetails1, "200", 5, 10, "")
metricCollector.AddMetric(apiDetails1, "200", 10, 10, "")
Expand All @@ -712,7 +712,7 @@ func TestMetricCollectorCache(t *testing.T) {
myCollector = createMetricCollector()
metricCollector = myCollector.(*collector)
metricCollector.usagePublisher.schedule = "* * * * *"
metricCollector.usagePublisher.report.currTimeFunc = getYesterdayTime
metricCollector.usagePublisher.report.currTimeFunc = getFutureTime

metricCollector.AddMetric(apiDetails1, "200", 5, 10, "")
metricCollector.AddMetric(apiDetails1, "200", 10, 10, "")
Expand All @@ -734,7 +734,7 @@ func TestMetricCollectorCache(t *testing.T) {
myCollector = createMetricCollector()
metricCollector = myCollector.(*collector)
metricCollector.usagePublisher.schedule = "* * * * *"
metricCollector.usagePublisher.report.currTimeFunc = getYesterdayTime
metricCollector.usagePublisher.report.currTimeFunc = getFutureTime

metricCollector.Execute()
// Validate only no usage report sent as no previous or new transactions
Expand Down

0 comments on commit 7120f70

Please sign in to comment.