mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-23 22:19:13 +00:00
Merge branch 'master' into bug5627
This commit is contained in:
+9
-1
@@ -169,13 +169,21 @@ public class TestORCPublicCertificateDatabase {
|
||||
*/ null, /* includeInvalid */ false);
|
||||
}
|
||||
if (Util.isEmpty(certHandles)) {
|
||||
// there were certs; get one from the previous year
|
||||
// there were certs; try searching by reference number
|
||||
certHandles = db.search(null, LocalDate.now().getYear(), cert.getReferenceNumber(), /* boat name may have deviated due to special characters */ null,
|
||||
cert.getSailNumber(), /*
|
||||
* boat class name; could be set to cert.getBoatClassName() but there are
|
||||
* deviations in ORC DBs and query API, so leaving null:
|
||||
*/ null, /* includeInvalid */ false);
|
||||
}
|
||||
if (Util.isEmpty(certHandles)) {
|
||||
// still nothing? Then try by reference number in previous year:
|
||||
certHandles = db.search(null, LocalDate.now().getYear()-1, cert.getReferenceNumber(), /* boat name may have deviated due to special characters */ null,
|
||||
cert.getSailNumber(), /*
|
||||
* boat class name; could be set to cert.getBoatClassName() but there are
|
||||
* deviations in ORC DBs and query API, so leaving null:
|
||||
*/ null, /* includeInvalid */ false);
|
||||
}
|
||||
Optional<CertificateHandle> certificateHandle = Optional.ofNullable(certHandles.iterator().hasNext() ? certHandles.iterator().next() : null);
|
||||
assertTrue("No certificate found for handle "+certificateHandle+
|
||||
" extracted from certificates "+certificates, certificateHandle.isPresent());
|
||||
|
||||
Reference in New Issue
Block a user