(t *testing.T)
| 457 | } |
| 458 | |
| 459 | func TestSharedState_RawWithContextVariants(t *testing.T) { |
| 460 | t.Parallel() |
| 461 | |
| 462 | type testContextKey string |
| 463 | |
| 464 | ctxKey := testContextKey("tenant") |
| 465 | store := &contextCheckingStorage{ctxKey: ctxKey, base: newSharedStateMemoryStorage(t)} |
| 466 | app := New(Config{SharedStorage: store}) |
| 467 | |
| 468 | err := app.SharedState().SetWithContext(context.Background(), "raw", []byte("x"), time.Second) |
| 469 | require.Error(t, err) |
| 470 | |
| 471 | ctx := context.WithValue(context.Background(), ctxKey, "value") |
| 472 | require.NoError(t, app.SharedState().SetWithContext(ctx, "raw", []byte("x"), time.Second)) |
| 473 | |
| 474 | raw, found, err := app.SharedState().GetWithContext(ctx, "raw") |
| 475 | require.NoError(t, err) |
| 476 | require.True(t, found) |
| 477 | require.Equal(t, []byte("x"), raw) |
| 478 | } |
| 479 | |
| 480 | func TestSharedState_SetGet_RawDataKinds(t *testing.T) { |
| 481 | t.Parallel() |
nothing calls this directly
no test coverage detected