Search in sources :

Example 1 with Certificate

use of com.stnetix.ariaddna.persistence.entities.Certificate in project ariADDna by StnetixDevTeam.

the class CertificateTransformerTest method certificateEntityToDTOTest.

@Test
public void certificateEntityToDTOTest() throws Exception {
    Certificate certificate = new Certificate();
    UUID uuid = UUID.randomUUID();
    certificate.setId(1L);
    certificate.setUuid(uuid.toString());
    certificate.setActive(true);
    CertificateDTO certificateDTO = transformer.certificateEntityToDTO(certificate);
    assertNotEquals(certificateDTO, certificate);
    assertEquals(certificate.getUuid(), certificateDTO.getUuid());
    assertEquals(certificate.getId(), certificateDTO.getId());
    assertEquals(certificate.getActive(), certificateDTO.getActive());
}
Also used : CertificateDTO(com.stnetix.ariaddna.commonutils.dto.CertificateDTO) UUID(java.util.UUID) Certificate(com.stnetix.ariaddna.persistence.entities.Certificate) Test(org.junit.Test)

Example 2 with Certificate

use of com.stnetix.ariaddna.persistence.entities.Certificate in project ariADDna by StnetixDevTeam.

the class CertificateTransformerTest method certificateDTOToEntityTest.

@Test
public void certificateDTOToEntityTest() throws Exception {
    CertificateDTO certificateDTO = new CertificateDTO();
    UUID uuid = UUID.randomUUID();
    certificateDTO.setId(1L);
    certificateDTO.setUuid(uuid.toString());
    certificateDTO.setActive(true);
    Certificate certificate = transformer.certificateDTOToEntity(certificateDTO);
    assertNotEquals(certificate, certificateDTO);
    assertEquals(certificate.getUuid(), certificateDTO.getUuid());
    assertEquals(certificate.getId(), certificateDTO.getId());
    assertEquals(certificate.getActive(), certificateDTO.getActive());
}
Also used : CertificateDTO(com.stnetix.ariaddna.commonutils.dto.CertificateDTO) UUID(java.util.UUID) Certificate(com.stnetix.ariaddna.persistence.entities.Certificate) Test(org.junit.Test)

Example 3 with Certificate

use of com.stnetix.ariaddna.persistence.entities.Certificate in project ariADDna by StnetixDevTeam.

the class CertificateServiceImpl method remove.

@Override
public void remove(CertificateDTO certificateDTO) {
    Certificate certificate = tranformer.certificateDTOToEntity(certificateDTO);
    repository.delete(certificate);
}
Also used : Certificate(com.stnetix.ariaddna.persistence.entities.Certificate)

Aggregations

Certificate (com.stnetix.ariaddna.persistence.entities.Certificate)3 CertificateDTO (com.stnetix.ariaddna.commonutils.dto.CertificateDTO)2 UUID (java.util.UUID)2 Test (org.junit.Test)2