contextOf method

Map<String, Object?> contextOf(
  1. String endUserId
)

The runtime context the fake holds for endUserId (from context frames and PUT/PATCH calls), for assertions.

Implementation

Map<String, Object?> contextOf(String endUserId) =>
    Map<String, Object?>.unmodifiable(
      _sessions.values
              .where((s) => s.endUserId == endUserId && !s.expired)
              .map((s) => s.context)
              .lastOrNull ??
          const <String, Object?>{},
    );