(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestCallbackHandlerSuccess(t *testing.T) { |
| 33 | rec, res := serveCallback(t, "state123", "code=the-code&state=state123") |
| 34 | |
| 35 | require.NoError(t, res.err) |
| 36 | assert.Equal(t, "the-code", res.code) |
| 37 | assert.Equal(t, http.StatusOK, rec.Code) |
| 38 | assert.Contains(t, rec.Body.String(), "Authorization Successful") |
| 39 | } |
| 40 | |
| 41 | func TestCallbackHandlerStateMismatch(t *testing.T) { |
| 42 | rec, res := serveCallback(t, "expected", "code=the-code&state=attacker") |
nothing calls this directly
no test coverage detected