feat: Add basic certificate models and repositories #8

Merged
torge-hmn merged 4 commits from certificate-models into main 2024-11-17 21:35:27 +00:00
2 changed files with 6 additions and 5 deletions
Showing only changes of commit a2ced3533a - Show all commits

View file

@ -1,7 +1,8 @@
package de.mlessmann.certassist.models; package de.mlessmann.certassist.models;
public enum CertificateType { public enum CertificateType {
ROOT_AUTHORITY, ROOT_CA,
STANDALONE_CERTIFICATE, STANDALONE_CERT,
NORMAL_CERTIFICATE, SIGNED_CERT,
CLIENT_CERT
} }

View file

@ -23,7 +23,7 @@ class CertificateRepositoryTest {
private Certificate getCertificate() { private Certificate getCertificate() {
final Certificate certificate = new Certificate(); final Certificate certificate = new Certificate();
certificate.setCommonName("test-cn"); certificate.setCommonName("test-cn");
certificate.setType(CertificateType.NORMAL_CERTIFICATE); certificate.setType(CertificateType.SIGNED_CERT);
certificate.setRequestedKeyLength(1); certificate.setRequestedKeyLength(1);
certificate.setRequestedValidityDays(1); certificate.setRequestedValidityDays(1);
@ -38,7 +38,7 @@ class CertificateRepositoryTest {
Certificate foundCertificate = repository.findById(certificate.getId()).orElseThrow(); Certificate foundCertificate = repository.findById(certificate.getId()).orElseThrow();
assertThat(foundCertificate.getCommonName()).isEqualTo("test-cn"); assertThat(foundCertificate.getCommonName()).isEqualTo("test-cn");
assertThat(foundCertificate.getType()).isEqualTo(CertificateType.NORMAL_CERTIFICATE); assertThat(foundCertificate.getType()).isEqualTo(CertificateType.SIGNED_CERT);
} }
@Test @Test