@Test public void should_delete_certificate() throws Exception { InputStream stream = getClass().getResourceAsStream(CERTIFICATE_FILE); byte[] certificate = toByteArray(stream); personalCertificateService.deletePersonalCertificateIfPresent(certificate); verify(personalRepository).deletePersonalCertificate( CERTIFICATE_HASH); verifyNoMoreInteractions(logbookOperationsClientFactory, personalRepository); }
public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException { ParsedCertificate parsedCertificate = ParsedCertificate.parseCertificate(certificate); personalRepository.deletePersonalCertificate(parsedCertificate.getCertificateHash()); }
PersonalCertificateService { public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException { ParsedCertificate parsedCertificate = ParsedCertificate.parseCertificate(certificate); personalRepository.deletePersonalCertificate(parsedCertificate.getCertificateHash()); } }
PersonalCertificateService { public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException { ParsedCertificate parsedCertificate = ParsedCertificate.parseCertificate(certificate); personalRepository.deletePersonalCertificate(parsedCertificate.getCertificateHash()); } PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory,
        PersonalRepository personalRepository); }
PersonalCertificateService { public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException { ParsedCertificate parsedCertificate = ParsedCertificate.parseCertificate(certificate); personalRepository.deletePersonalCertificate(parsedCertificate.getCertificateHash()); } PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory,
        PersonalRepository personalRepository); void createPersonalCertificateIfNotPresent(byte[] certificate); void deletePersonalCertificateIfPresent(byte[] certificate); void checkPersonalCertificateExistence(byte[] certificate, String permission); }
PersonalCertificateService { public void deletePersonalCertificateIfPresent(byte[] certificate) throws PersonalCertificateException { ParsedCertificate parsedCertificate = ParsedCertificate.parseCertificate(certificate); personalRepository.deletePersonalCertificate(parsedCertificate.getCertificateHash()); } PersonalCertificateService(LogbookOperationsClientFactory logbookOperationsClientFactory,
        PersonalRepository personalRepository); void createPersonalCertificateIfNotPresent(byte[] certificate); void deletePersonalCertificateIfPresent(byte[] certificate); void checkPersonalCertificateExistence(byte[] certificate, String permission);  }