| | |
| | | private static final Clock CLOCK = Clock.fixed(CAPTURED_AT, ZoneOffset.UTC); |
| | | |
| | | @Test |
| | | void recordsOfflineSourcesInBackgroundEvenWithoutSuccessfulSamples() { |
| | | Fixture fixture = fixture(); |
| | | when(fixture.mapper.selectOfflineTestSources(1L)).thenReturn(List.of( |
| | | new com.battery.business.domain.vo.OfflineTestSource("COLLECTOR", "9"))); |
| | | var service = fixture.service(); |
| | | |
| | | service.captureReceivedData(); |
| | | service.captureReceivedData(); |
| | | |
| | | verify(fixture.mapper).upsertOfflineException(1L, "COLLECTOR", "9", Date.from(CAPTURED_AT)); |
| | | verify(fixture.mapper, never()).insertRealtimeRecord(any()); |
| | | when(fixture.mapper.selectTestByIdForUpdate(1L)).thenReturn(null); |
| | | service.captureReceivedData(); |
| | | verify(fixture.mapper, times(1)).selectOfflineTestSources(1L); |
| | | } |
| | | |
| | | @Test |
| | | void savesOneCombinedRealtimeRowForOneBatteryPollingSlot() |
| | | { |
| | | Fixture fixture = fixture(); |