diff options
Diffstat (limited to 'userapi/userapi_test.go')
-rw-r--r-- | userapi/userapi_test.go | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/userapi/userapi_test.go b/userapi/userapi_test.go index dada56de..68d08c2f 100644 --- a/userapi/userapi_test.go +++ b/userapi/userapi_test.go @@ -17,23 +17,18 @@ package userapi_test import ( "context" "fmt" - "net/http" "reflect" "testing" "time" - "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "golang.org/x/crypto/bcrypt" - "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/test" "github.com/matrix-org/dendrite/test/testrig" - "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/internal" - "github.com/matrix-org/dendrite/userapi/inthttp" "github.com/matrix-org/dendrite/userapi/storage" ) @@ -142,20 +137,7 @@ func TestQueryProfile(t *testing.T) { t.Fatalf("failed to set display name: %s", err) } - t.Run("HTTP API", func(t *testing.T) { - router := mux.NewRouter().PathPrefix(httputil.InternalPathPrefix).Subrouter() - userapi.AddInternalRoutes(router, userAPI, false) - apiURL, cancel := test.ListenAndServe(t, router, false) - defer cancel() - httpAPI, err := inthttp.NewUserAPIClient(apiURL, &http.Client{}) - if err != nil { - t.Fatalf("failed to create HTTP client") - } - runCases(httpAPI, true) - }) - t.Run("Monolith", func(t *testing.T) { - runCases(userAPI, false) - }) + runCases(userAPI, false) }) } @@ -347,24 +329,6 @@ func TestQueryAccountByLocalpart(t *testing.T) { } } - t.Run("Monolith", func(t *testing.T) { - testCases(t, intAPI) - // also test tracing - testCases(t, &api.UserInternalAPITrace{Impl: intAPI}) - }) - - t.Run("HTTP API", func(t *testing.T) { - router := mux.NewRouter().PathPrefix(httputil.InternalPathPrefix).Subrouter() - userapi.AddInternalRoutes(router, intAPI, false) - apiURL, cancel := test.ListenAndServe(t, router, false) - defer cancel() - - userHTTPApi, err := inthttp.NewUserAPIClient(apiURL, &http.Client{Timeout: time.Second * 5}) - if err != nil { - t.Fatalf("failed to create HTTP client: %s", err) - } - testCases(t, userHTTPApi) - - }) + testCases(t, intAPI) }) } |