Test_SessionManager_SetRaw_StoreError covers the error branch when the session store cannot be loaded during setRaw.
(t *testing.T)
| 2921 | // Test_SessionManager_SetRaw_StoreError covers the error branch when the session |
| 2922 | // store cannot be loaded during setRaw. |
| 2923 | func Test_SessionManager_SetRaw_StoreError(t *testing.T) { |
| 2924 | t.Parallel() |
| 2925 | |
| 2926 | storage := newFlakySessionStorage() |
| 2927 | storage.failGet = true |
| 2928 | store := session.NewStore(session.Config{ |
| 2929 | Storage: storage, |
| 2930 | Extractor: extractors.FromCookie("session_id"), |
| 2931 | }) |
| 2932 | m := newSessionManager(store) |
| 2933 | |
| 2934 | app := fiber.New() |
| 2935 | c := newSessionCtx(app, "abc") |
| 2936 | defer app.ReleaseCtx(c) |
| 2937 | |
| 2938 | require.NotPanics(t, func() { |
| 2939 | m.setRaw(c, "key", dummyValue, time.Minute) |
| 2940 | }) |
| 2941 | } |
| 2942 | |
| 2943 | // Test_SessionManager_SetRaw_SaveError covers the save-failure warning branch of |
| 2944 | // setRaw, where the store loads successfully but persisting it fails. |
nothing calls this directly
no test coverage detected