class RecordingMap<K, V> : MutableMap<K, V>A RecordingMap wraps a regular Map<K, V> and records the sequence of gets and puts to it. This is useful in white box unit tests to ensure that code is accessing a data store as much as you expect.
Note: although this class itself thread safe, if the underlying map is not, then this class loses its thread safety.
| Get |
data class Get<out K> : Record |
| Put |
data class Put<out K, out V> : Record |
| Record |
interface Record |
| <init> |
RecordingMap(wrappedMap: MutableMap<K, V>, logger: <ERROR CLASS> = loggerFor<RecordingMap<K, V>>())A RecordingMap wraps a regular Map<K, V> and records the sequence of gets and puts to it. This is useful in white box unit tests to ensure that code is accessing a data store as much as you expect. |
| records |
val records: List<Record>Returns a snapshot of the set of records |
| clearRecords |
fun clearRecords(): Unit |
| get |
fun get(key: K): V? |
| put |
fun put(key: K, value: V): V? |
| putAll |
fun putAll(from: Map<out K, V>): Unit |
| putAllUnrecorded |
fun putAllUnrecorded(from: Map<out K, V>): Unit |