| | |
| | | import static org.mockito.ArgumentMatchers.eq; |
| | | import static org.mockito.ArgumentMatchers.isNull; |
| | | import static org.mockito.Mockito.mock; |
| | | import static org.mockito.Mockito.never; |
| | | import static org.mockito.Mockito.times; |
| | | import static org.mockito.Mockito.verify; |
| | | import static org.mockito.Mockito.when; |
| | |
| | | any(byte[].class)); |
| | | } |
| | | |
| | | @Test |
| | | void doesNotWriteSamplesWhenNoSuccessfulRecordsAreAvailable() |
| | | { |
| | | TTestMapper mapper = mock(TTestMapper.class); |
| | | ITTestService tests = mock(ITTestService.class); |
| | | BtsDevelopmentSimulator simulator = mock(BtsDevelopmentSimulator.class); |
| | | TTest test = test(Date.from(Instant.parse("2026-09-02T04:00:00Z"))); |
| | | when(mapper.selectReceivingTestIds()).thenReturn(List.of(1L)); |
| | | when(mapper.selectTestByIdForUpdate(1L)).thenReturn(test); |
| | | when(tests.selectTestById(1L)).thenReturn(test); |
| | | when(simulator.btsRecords(1, 1)).thenReturn(List.of()); |
| | | |
| | | new TestDataReceptionServiceImpl(mapper, tests, simulator).captureDevelopmentCabinetRecords(); |
| | | |
| | | verify(mapper, never()).insertBtsSample(any(), any(), any(), anyString(), any(), any(Date.class), anyString(), |
| | | any(Date.class), anyInt(), anyInt(), anyString(), anyString(), isNull(), any(BigDecimal.class), |
| | | any(BigDecimal.class), any(BigDecimal.class), any(BigDecimal.class), any(byte[].class)); |
| | | } |
| | | |
| | | private static TTest test(Date startedAt) |
| | | { |
| | | TTestChannelBinding binding = new TTestChannelBinding(); |