summaryrefslogtreecommitdiff
path: root/app/controllers/sparkles/controller_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/sparkles/controller_test.go')
-rw-r--r--app/controllers/sparkles/controller_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/sparkles/controller_test.go b/app/controllers/sparkles/controller_test.go
index e825343..710118d 100644
--- a/app/controllers/sparkles/controller_test.go
+++ b/app/controllers/sparkles/controller_test.go
@@ -11,6 +11,7 @@ import (
"github.com/xlgmokha/x/pkg/event"
"github.com/xlgmokha/x/pkg/serde"
"github.com/xlgmokha/x/pkg/test"
+ "github.com/xlgmokha/x/pkg/x"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/db"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
@@ -64,7 +65,7 @@ func TestSparkles(t *testing.T) {
t.Run("POST /sparkles", func(t *testing.T) {
t.Run("when a user is authenticated", func(t *testing.T) {
- currentUser := domain.NewUser(domain.WithID[*domain.User](domain.ID("1")))
+ currentUser := x.New[*domain.User](domain.WithID[*domain.User](domain.ID("1")))
repository := db.NewRepository[*domain.Sparkle](event.New[*domain.Sparkle]())
t.Run("when the user is authorized", func(t *testing.T) {
@@ -106,7 +107,7 @@ func TestSparkles(t *testing.T) {
})
t.Run("prevents double WriteHeader when serialization fails", func(t *testing.T) {
- currentUser := domain.NewUser(domain.WithID[*domain.User](domain.ID("1")))
+ currentUser := x.New[*domain.User](domain.WithID[*domain.User](domain.ID("1")))
sparkle, _ := domain.NewSparkle("@user for testing")
request, response := test.RequestResponse(