// Path: src/main/java/de/galan/commons/util/Validations.java
// public class Validations {
// 
// 	private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();
// 
// 
// 	public static void validate(Object object) {
// 		Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object);
// 		if (!violations.isEmpty()) {
// 			String message = violations.stream()
// 				.map(violation -> violation.getPropertyPath() + " (" + violation.getMessage() + ")")
// 				.collect(joining(", "));
// 			throw new ConstraintViolationException(message, violations);
// 		}
// 	}
// 
// }


import static org.assertj.core.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.*;
import javax.validation.ConstraintViolationException;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import de.galan.commons.util.Validations;

	@Test
	public void validationOkTo() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientTo(new MailAddress("b@example.com"));
		Validations.validate(mail);
	}


	@Test
	public void validationOkCc() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientCc(new MailAddress("b@example.com"));
		Validations.validate(mail);
	}


	@Test
	public void validationOkBcc() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientBcc(new MailAddress("b@example.com"));
// Path: src/main/java/de/galan/commons/util/Validations.java
// public class Validations {
// 
// 	private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();
// 
// 
// 	public static void validate(Object object) {
// 		Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object);
// 		if (!violations.isEmpty()) {
// 			String message = violations.stream()
// 				.map(violation -> violation.getPropertyPath() + " (" + violation.getMessage() + ")")
// 				.collect(joining(", "));
// 			throw new ConstraintViolationException(message, violations);
// 		}
// 	}
// 
// }


// Path: src/test/java/de/galan/commons/net/mail/MailTest.java
import static org.assertj.core.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.*;
import javax.validation.ConstraintViolationException;
import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.guava.GuavaModule;
import de.galan.commons.util.Validations;


	@Test
	public void validationOkTo() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientTo(new MailAddress("b@example.com"));
		Validations.validate(mail);
	}


	@Test
	public void validationOkCc() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientCc(new MailAddress("b@example.com"));
		Validations.validate(mail);
	}


	@Test
	public void validationOkBcc() throws Exception {
		Mail mail = new Mail();
		mail.setSubject("subject");
		mail.setBodyText("bla");
		mail.from(new MailAddress("a@example.com"));
		mail.addRecipientBcc(new MailAddress("b@example.com"));
		Validations.validate(mail);