Skip to content

Commit cada579

Browse files
Add REST API fakes for services endpoints (#485)
- Adds REST API fakes for services GET and DELETE - A _lot_ of boilerplate for factories for all the types of services (and runtimes) we support This is supporting work for GROW-2072 I want to be able to write some high-quality tests for service update and delete! GitOrigin-RevId: 9a04036e6c45bbe389364910ae52990cd6726aef
1 parent f617155 commit cada579

5 files changed

Lines changed: 804 additions & 0 deletions

File tree

internal/fakes/renderapi/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ type Server struct {
281281
Environments *Resource[*client.Environment]
282282
KV *KVResource
283283
Postgres *PostgresResource
284+
Services *ServiceResource
284285
}
285286

286287
// ownerByID returns the Owner with the given ID from the seeded owners. The
@@ -327,6 +328,7 @@ func NewServer(t *testing.T) *Server {
327328
Environments: &Resource[*client.Environment]{},
328329
KV: &KVResource{},
329330
Postgres: &PostgresResource{},
331+
Services: &ServiceResource{},
330332
}
331333

332334
mux := http.NewServeMux()
@@ -923,6 +925,8 @@ func NewServer(t *testing.T) *Server {
923925
writeJSON(w, http.StatusOK, pg)
924926
})
925927

928+
registerServiceRoutes(mux, s, record)
929+
926930
s.server = httptest.NewServer(mux)
927931
t.Cleanup(s.server.Close)
928932
return s

0 commit comments

Comments
 (0)