Test_SessionManager_GetRaw_StoreError covers the error branch when loading the session from the store fails.
(t *testing.T)
| 2901 | // Test_SessionManager_GetRaw_StoreError covers the error branch when loading the |
| 2902 | // session from the store fails. |
| 2903 | func Test_SessionManager_GetRaw_StoreError(t *testing.T) { |
| 2904 | t.Parallel() |
| 2905 | |
| 2906 | storage := newFlakySessionStorage() |
| 2907 | storage.failGet = true |
| 2908 | store := session.NewStore(session.Config{ |
| 2909 | Storage: storage, |
| 2910 | Extractor: extractors.FromCookie("session_id"), |
| 2911 | }) |
| 2912 | m := newSessionManager(store) |
| 2913 | |
| 2914 | app := fiber.New() |
| 2915 | c := newSessionCtx(app, "abc") |
| 2916 | defer app.ReleaseCtx(c) |
| 2917 | |
| 2918 | require.Nil(t, m.getRaw(c, "key", dummyValue)) |
| 2919 | } |
| 2920 | |
| 2921 | // Test_SessionManager_SetRaw_StoreError covers the error branch when the session |
| 2922 | // store cannot be loaded during setRaw. |
nothing calls this directly
no test coverage detected