54 lines
1.5 KiB
Java
54 lines
1.5 KiB
Java
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("<p>Bonjour {{nom}}</p>");
|
|
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();
|
|
}
|
|
}
|