clusterTestRouter mounts the cluster-topology endpoints on a fresh gin engine backed by a fake clientset seeded with objs.
(objs ...runtime.Object)
| 23 | // clusterTestRouter mounts the cluster-topology endpoints on a fresh gin engine |
| 24 | // backed by a fake clientset seeded with objs. |
| 25 | func clusterTestRouter(objs ...runtime.Object) *gin.Engine { |
| 26 | gin.SetMode(gin.TestMode) |
| 27 | cs := fake.NewSimpleClientset(objs...) |
| 28 | e := gin.New() |
| 29 | registerClusterAPI(e.Group("/api/v1"), cs) |
| 30 | return e |
| 31 | } |
| 32 | |
| 33 | func getJSON(t *testing.T, e *gin.Engine, path string) map[string]any { |
| 34 | t.Helper() |
no test coverage detected