(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestListHooks(t *testing.T) { |
| 91 | router, _, err := setupRouter(t) |
| 92 | if err != nil { |
| 93 | t.Fatalf("Failed to setup router: %v", err) |
| 94 | } |
| 95 | |
| 96 | t.Run("List all hooks", func(t *testing.T) { |
| 97 | req := httptest.NewRequest("GET", "/hooks", nil) |
| 98 | resp := httptest.NewRecorder() |
| 99 | router.ServeHTTP(resp, req) |
| 100 | assert.Equal(t, http.StatusOK, resp.Code) |
| 101 | }) |
| 102 | |
| 103 | t.Run("List hooks by type", func(t *testing.T) { |
| 104 | req := httptest.NewRequest("GET", "/hooks?type=PRE_TRANSACTION", nil) |
| 105 | resp := httptest.NewRecorder() |
| 106 | router.ServeHTTP(resp, req) |
| 107 | assert.Equal(t, http.StatusOK, resp.Code) |
| 108 | }) |
| 109 | } |
| 110 | |
| 111 | func TestDeleteHook(t *testing.T) { |
| 112 | router, _, err := setupRouter(t) |
nothing calls this directly
no test coverage detected