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

import static it.sw.pa.comune.artegna.domain.LiberatoriaTestSamples.*;
import static it.sw.pa.comune.artegna.domain.ModelloLiberatoriaTestSamples.*;
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 LiberatoriaTest {

    @Test
    void equalsVerifier() throws Exception {
        TestUtil.equalsVerifier(Liberatoria.class);
        Liberatoria liberatoria1 = getLiberatoriaSample1();
        Liberatoria liberatoria2 = new Liberatoria();
        assertThat(liberatoria1).isNotEqualTo(liberatoria2);

        liberatoria2.setId(liberatoria1.getId());
        assertThat(liberatoria1).isEqualTo(liberatoria2);

        liberatoria2 = getLiberatoriaSample2();
        assertThat(liberatoria1).isNotEqualTo(liberatoria2);
    }

    @Test
    void utenteTest() {
        Liberatoria liberatoria = getLiberatoriaRandomSampleGenerator();
        UtenteApp utenteAppBack = getUtenteAppRandomSampleGenerator();

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

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

    @Test
    void modelloLiberatoriaTest() {
        Liberatoria liberatoria = getLiberatoriaRandomSampleGenerator();
        ModelloLiberatoria modelloLiberatoriaBack = getModelloLiberatoriaRandomSampleGenerator();

        liberatoria.setModelloLiberatoria(modelloLiberatoriaBack);
        assertThat(liberatoria.getModelloLiberatoria()).isEqualTo(modelloLiberatoriaBack);

        liberatoria.modelloLiberatoria(null);
        assertThat(liberatoria.getModelloLiberatoria()).isNull();
    }
}
