diff --git a/cmd/testapi/main.go b/cmd/testapi/main.go index a7f89c0..a832b26 100644 --- a/cmd/testapi/main.go +++ b/cmd/testapi/main.go @@ -124,6 +124,11 @@ func (s *S) injectContext(w http.ResponseWriter, r *http.Request) error { return nil } +func (s *S) Session(ctx context.Context) Session { + v, _ := ctx.Value("session").(Session) + return v +} + func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error { ctx := r.Context() @@ -167,5 +172,11 @@ func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error { } func (s *S) serveV1(w http.ResponseWriter, r *http.Request) error { - return fmt.Errorf("not impl: v1") + ctx := r.Context() + switch r.Method + r.URL.Path { + case "PUT/v1/state/" + s.Session(ctx).ID + "/party": + return nil + } + http.NotFound(w, r) + return nil }