### Question:
JarSignatureOperations { public List<X509Certificate> readCertificates(String certificatesFilename) { try (InputStream certificatesInputStream = getClass().getResourceAsStream(certificatesFilename)) { CertificateFactory certificateFactory = CertificateFactory.getInstance(Constants.CERTIFICATE_TYPE_X_509); return (List<X509Certificate>) certificateFactory.generateCertificates(certificatesInputStream); } catch (CertificateException | IOException e) { throw new SLException(e, e.getMessage()); } }  void checkCertificates(URL url, List<X509Certificate> certificates, String certificateCN); List<X509Certificate> readCertificates(String certificatesFilename);  }### Answer:
@Test void testGetCertificatesCheckWhetherSymantecExists() { List<X509Certificate> providedCertificates = mtaCertificateChecker.readCertificates(Constants.SYMANTEC_CERTIFICATE_FILE); Assertions.assertEquals(1, providedCertificates.size()); Assertions.assertEquals(SYMANTEC_SUBJECT_DN, providedCertificates.get(0) .getSubjectDN() .toString()); Assertions.assertEquals(SYMANTEC_ISSUER_DN, providedCertificates.get(0) .getIssuerDN() .toString()); }
@Test void testGetCertificatesWithNullInputStream() { SLException exception = Assertions.assertThrows(SLException.class, () -> mtaCertificateChecker.readCertificates("non-existing-certificate.crt")); Assertions.assertEquals("Missing input stream", exception.getMessage()); }