Fix build: Update tests for image download refactor

- Remove RateLimitedHttpClient from ImageProcessingService constructor
- Rewrite ImageProcessingServiceTest to test new object detection workflow
- Fix IntegrationTest constructor call
- Add insertImage() back to DatabaseService for test compatibility
- Tests now focus on object detection rather than image downloading


Former-commit-id: e216a763ac
This commit is contained in:
Tour
2025-12-06 21:34:29 +01:00
parent 9baaca9013
commit f750f211db
3 changed files with 135 additions and 172 deletions

View File

@@ -469,6 +469,22 @@ public class DatabaseService {
}
}
/**
* Inserts a complete image record (for testing/legacy compatibility).
* In production, scraper inserts with local_path, monitor updates labels via updateImageLabels.
*/
synchronized void insertImage(long lotId, String url, String filePath, List<String> labels) throws SQLException {
var sql = "INSERT INTO images (lot_id, url, local_path, labels, processed_at, downloaded) VALUES (?, ?, ?, ?, ?, 1)";
try (var conn = DriverManager.getConnection(this.url); var ps = conn.prepareStatement(sql)) {
ps.setLong(1, lotId);
ps.setString(2, url);
ps.setString(3, filePath);
ps.setString(4, String.join(",", labels));
ps.setLong(5, Instant.now().getEpochSecond());
ps.executeUpdate();
}
}
/**
* Updates the labels field for an image after object detection
*/