Skip to content

Commit

Permalink
Fix reports service test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Apr 5, 2023
1 parent 1d6ebce commit 0df1f03
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/app/reports/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"
"time"

"github.com/datacite/keeshond/internal/app/event"
"github.com/datacite/keeshond/internal/app/stats"
)

Expand Down Expand Up @@ -92,6 +93,13 @@ func (m *MockStatsService) Aggregate(repoId string, query stats.Query) stats.Agg
}
}

// Mock LastEvent
func (m *MockStatsService) LastEvent(repoId string) (event.Event, bool) {
var e event.Event

return e, true
}

// Test that the service can generate a dataset usage report
func TestGenerateDatasetUsageReport(t *testing.T) {
// Create a mock stats service
Expand Down

0 comments on commit 0df1f03

Please sign in to comment.