use of com.stnetix.ariaddna.commonutils.dto.CertificateDTO 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());
}
use of com.stnetix.ariaddna.commonutils.dto.CertificateDTO 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());
}
use of com.stnetix.ariaddna.commonutils.dto.CertificateDTO in project ariADDna by StnetixDevTeam.
the class PersistHelperImpl method getTargetCert.
private CertificateDTO getTargetCert(String alias) {
List<CertificateDTO> certList = certificateService.getAllCertificates();
CertificateDTO target = null;
for (CertificateDTO cert : certList) {
if (cert.getUuid().equalsIgnoreCase(alias)) {
target = cert;
break;
}
}
return target;
}
use of com.stnetix.ariaddna.commonutils.dto.CertificateDTO in project ariADDna by StnetixDevTeam.
the class PersistHelperImpl method setCertificateDisable.
@Override
public void setCertificateDisable(String alias) {
CertificateDTO target = getTargetCert(alias);
if (target != null) {
target.setActive(false);
certificateService.save(target);
}
}
Aggregations