public Certificate getCertificate(Long id) {
        Optional<Certificate> cert = certificateRepository.findById(id);
        if (!cert.isPresent()) {
            throw new NotFoundException("Could not find certificate with id: " + id);
        }
        return cert.get();
    }
@Test
    public void getCertificate() {
        Certificate certificate = new Certificate();
        certificate.setId(1L);
        Optional<Certificate> certificateOptional = Optional.of(certificate);
        when(certificateRepositoryMock.findById(anyLong())).thenReturn(certificateOptional);

        Certificate result = certificateServiceMock.getCertificate(anyLong());

        verify(certificateRepositoryMock, times(1)).findById(anyLong());
        assertEquals(certificateOptional.get().getId(), result.getId());
    }