We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee9dff commit 77c0de1Copy full SHA for 77c0de1
mithril-aggregator/src/event_store/database/repository.rs
@@ -279,5 +279,21 @@ mod tests {
279
assert!(result.contains(&(9, "1.0.2".to_string(), 40, 28, "70 %".to_string(), 1)));
280
assert!(result.contains(&(9, "1.0.4".to_string(), 40, 12, "30 %".to_string(), 1)));
281
}
282
+
283
+ #[test]
284
+ fn with_multi_registrations_for_an_epoch_only_the_last_recorded_one_is_retained() {
285
+ let connection = Arc::new(event_store_db_connection().unwrap());
286
+ let persister = EventPersister::new(connection.clone());
287
288
+ insert_registration_event(&persister, "8", "A", 6, "1.0.2");
289
+ insert_registration_event(&persister, "8", "A", 8, "1.0.2");
290
+ insert_registration_event(&persister, "8", "A", 10, "1.0.4");
291
+ insert_registration_event(&persister, "8", "A", 7, "1.0.3");
292
293
+ let result = get_all_registrations(connection).unwrap();
294
295
+ assert!(result.contains(&(8, "1.0.3".to_string(), 7, 7, "100 %".to_string(), 1)));
296
+ assert!(result.len() == 1);
297
+ }
298
299
0 commit comments