aboutsummaryrefslogtreecommitdiff
path: root/userapi/consumers/roomserver_test.go
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-19 15:50:33 +0100
committerGitHub <noreply@github.com>2023-04-19 15:50:33 +0100
commit72285b2659a31ebd52c91799c17105d81d996f40 (patch)
tree1855395f5efdc3ea6051dd502882bf62aaa57e7c /userapi/consumers/roomserver_test.go
parent9fa39263c0a4a8d349c8715f6ba30cae30b1b73a (diff)
refactor: update GMSL (#3058)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
Diffstat (limited to 'userapi/consumers/roomserver_test.go')
-rw-r--r--userapi/consumers/roomserver_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/userapi/consumers/roomserver_test.go b/userapi/consumers/roomserver_test.go
index 4827ad47..e233bc66 100644
--- a/userapi/consumers/roomserver_test.go
+++ b/userapi/consumers/roomserver_test.go
@@ -9,6 +9,7 @@ import (
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/stretchr/testify/assert"
"github.com/matrix-org/dendrite/internal/pushrules"
@@ -139,9 +140,9 @@ func TestMessageStats(t *testing.T) {
tests := []struct {
name string
args args
- ourServer gomatrixserverlib.ServerName
+ ourServer spec.ServerName
lastUpdate time.Time
- initRoomCounts map[gomatrixserverlib.ServerName]map[string]bool
+ initRoomCounts map[spec.ServerName]map[string]bool
wantStats userAPITypes.MessageStats
}{
{
@@ -197,7 +198,7 @@ func TestMessageStats(t *testing.T) {
name: "day change creates a new room map",
ourServer: "localhost",
lastUpdate: time.Now().Add(-time.Hour * 24),
- initRoomCounts: map[gomatrixserverlib.ServerName]map[string]bool{
+ initRoomCounts: map[spec.ServerName]map[string]bool{
"localhost": {"encryptedRoom": true},
},
args: args{
@@ -219,11 +220,11 @@ func TestMessageStats(t *testing.T) {
tt.lastUpdate = time.Now()
}
if tt.initRoomCounts == nil {
- tt.initRoomCounts = map[gomatrixserverlib.ServerName]map[string]bool{}
+ tt.initRoomCounts = map[spec.ServerName]map[string]bool{}
}
s := &OutputRoomEventConsumer{
db: db,
- msgCounts: map[gomatrixserverlib.ServerName]userAPITypes.MessageStats{},
+ msgCounts: map[spec.ServerName]userAPITypes.MessageStats{},
roomCounts: tt.initRoomCounts,
countsLock: sync.Mutex{},
lastUpdate: tt.lastUpdate,