package it.sw.pa.comune.artegna.domain;

import static it.sw.pa.comune.artegna.domain.AuditLogTestSamples.*;
import static it.sw.pa.comune.artegna.domain.UtenteAppTestSamples.*;
import static org.assertj.core.api.Assertions.assertThat;

import it.sw.pa.comune.artegna.web.rest.TestUtil;
import org.junit.jupiter.api.Test;

class AuditLogTest {

    @Test
    void equalsVerifier() throws Exception {
        TestUtil.equalsVerifier(AuditLog.class);
        AuditLog auditLog1 = getAuditLogSample1();
        AuditLog auditLog2 = new AuditLog();
        assertThat(auditLog1).isNotEqualTo(auditLog2);

        auditLog2.setId(auditLog1.getId());
        assertThat(auditLog1).isEqualTo(auditLog2);

        auditLog2 = getAuditLogSample2();
        assertThat(auditLog1).isNotEqualTo(auditLog2);
    }

    @Test
    void utenteTest() {
        AuditLog auditLog = getAuditLogRandomSampleGenerator();
        UtenteApp utenteAppBack = getUtenteAppRandomSampleGenerator();

        auditLog.setUtente(utenteAppBack);
        assertThat(auditLog.getUtente()).isEqualTo(utenteAppBack);

        auditLog.utente(null);
        assertThat(auditLog.getUtente()).isNull();
    }
}
