package dev.lions.unionflow.server.entity; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @DisplayName("TemplateNotification") class TemplateNotificationTest { @Test @DisplayName("getters/setters") void gettersSetters() { TemplateNotification t = new TemplateNotification(); t.setCode("WELCOME"); t.setSujet("Bienvenue"); t.setCorpsTexte("Bonjour {{nom}}"); t.setCorpsHtml("
Bonjour {{nom}}
"); t.setLangue("fr"); t.setDescription("Template de bienvenue"); assertThat(t.getCode()).isEqualTo("WELCOME"); assertThat(t.getSujet()).isEqualTo("Bienvenue"); assertThat(t.getLangue()).isEqualTo("fr"); } @Test @DisplayName("equals et hashCode") void equalsHashCode() { UUID id = UUID.randomUUID(); TemplateNotification a = new TemplateNotification(); a.setId(id); a.setCode("C1"); a.setSujet("S1"); TemplateNotification b = new TemplateNotification(); b.setId(id); b.setCode("C1"); b.setSujet("S1"); assertThat(a).isEqualTo(b); assertThat(a.hashCode()).isEqualTo(b.hashCode()); } @Test @DisplayName("toString non null") void toString_nonNull() { TemplateNotification t = new TemplateNotification(); t.setCode("X"); t.setSujet("Y"); assertThat(t.toString()).isNotNull().isNotEmpty(); } }