|
21 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
22 | 22 | import org.springframework.boot.test.context.SpringBootTest; |
23 | 23 | import org.springframework.data.domain.PageRequest; |
| 24 | +import org.springframework.data.domain.Pageable; |
24 | 25 | import org.springframework.test.context.ActiveProfiles; |
25 | 26 |
|
26 | 27 | import java.lang.reflect.Modifier; |
@@ -81,7 +82,7 @@ void testExecuteQueries() { |
81 | 82 | scan.setPublisher("publisher"); |
82 | 83 | scan.setPublisherUrl("https://example.com"); |
83 | 84 | scan.setExtensionVersion(extVersion.getVersion()); |
84 | | - scan.setStartedAt(LocalDateTime.now()); |
| 85 | + scan.setStartedAt(NOW); |
85 | 86 | scan.setStatus(ScanStatus.STARTED); |
86 | 87 |
|
87 | 88 | var validationFailure = ExtensionValidationFailure.create("NAME_SQUATTING", "validation-name", "reason"); |
@@ -117,7 +118,7 @@ void testExecuteQueries() { |
117 | 118 | customer.setTier(tier); |
118 | 119 | var usageStats = new UsageStats(); |
119 | 120 | usageStats.setCustomer(customer); |
120 | | - usageStats.setWindowStart(LocalDateTime.now()); |
| 121 | + usageStats.setWindowStart(NOW); |
121 | 122 | usageStats.setDuration(Duration.ofMinutes(1)); |
122 | 123 |
|
123 | 124 | // Persist all entities consistently using EntityManager |
@@ -161,6 +162,9 @@ void testExecuteQueries() { |
161 | 162 | () -> repositories.findAdminStatisticsByYearAndMonth(1997, 1), |
162 | 163 | () -> repositories.findAllActiveExtensions(), |
163 | 164 | () -> repositories.findAllPersistedLogs(), |
| 165 | + () -> repositories.findPersistedLogsAfter(NOW), |
| 166 | + () -> repositories.findPersistedLogsPaginated(page), |
| 167 | + () -> repositories.findPersistedLogsAfterPaginated(NOW, page), |
164 | 168 | () -> repositories.findAllReviews(extension), |
165 | 169 | () -> repositories.findAllSucceededDownloadCountProcessedItemsByStorageTypeAndNameIn("storageType", STRING_LIST), |
166 | 170 | () -> repositories.findAllFailedDownloadCountProcessedItemsByStorageTypeAndNameIn("storageType", STRING_LIST), |
@@ -375,7 +379,7 @@ void testExecuteQueries() { |
375 | 379 | () -> repositories.countCustomersByTier(tier), |
376 | 380 | () -> repositories.findAllCustomers(), |
377 | 381 | () -> repositories.saveUsageStats(usageStats), |
378 | | - () -> repositories.findUsageStatsByCustomerAndDate(customer, LocalDateTime.now()), |
| 382 | + () -> repositories.findUsageStatsByCustomerAndDate(customer, NOW), |
379 | 383 | () -> repositories.deleteTier(tier), |
380 | 384 | () -> repositories.deleteCustomer(customer), |
381 | 385 | // Extension scan delete method - add last, still not clear why but otherwise the test fails |
|
0 commit comments