()
| 156 | } |
| 157 | |
| 158 | func (t *CallbacksTestSuite) TestPostsCallbacks() { |
| 159 | lockReceived := false |
| 160 | t.CutoverLock = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 161 | lockReceived = true |
| 162 | resp := t.requestMap(r) |
| 163 | t.Require().Equal("test_lock", resp["Payload"]) |
| 164 | }) |
| 165 | |
| 166 | unlockReceived := false |
| 167 | t.CutoverUnlock = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 168 | unlockReceived = true |
| 169 | resp := t.requestMap(r) |
| 170 | t.Require().Equal("test_unlock", resp["Payload"]) |
| 171 | }) |
| 172 | |
| 173 | t.Ferry.Run() |
| 174 | |
| 175 | t.Require().True(lockReceived) |
| 176 | t.Require().True(unlockReceived) |
| 177 | |
| 178 | t.AssertTenantCopied() |
| 179 | } |
| 180 | |
| 181 | func (t *CallbacksTestSuite) requestMap(r *http.Request) map[string]string { |
| 182 | defer r.Body.Close() |
nothing calls this directly
no test coverage detected