assertEquals(3, this.certSerialCurator.deleteExpiredSerials());
}
@Test
public void testListBySerialIds() {
CertificateSerial serial = createCS().withExpDate("03/10/2010")
.collected(false).revoked(false).save();
CertificateSerial serial1 = createCS().withExpDate("03/10/2012")
.collected(true).revoked(true).save();
String[] ids = new String[2];
ids[0] = String.valueOf(serial.getSerial());
ids[1] = String.valueOf(serial1.getSerial());
List<CertificateSerial> serials = certSerialCurator.listBySerialIds(ids);
assertEquals(2, serials.size());
// verify
Map<BigInteger, CertificateSerial> values =
new HashMap<BigInteger, CertificateSerial>();
for (CertificateSerial s : serials) {
values.put(s.getSerial(), s);
}
assertNotNull(values.get(serial.getSerial()));
assertNotNull(values.get(serial1.getSerial()));
}