// Path: spring-boot-email-core/src/main/java/it/ozimov/springboot/mail/model/defaultimpl/DefaultEmailAttachment.java
// @NoArgsConstructor
// @RequiredArgsConstructor
// @AllArgsConstructor
// @Builder
// @ToString(exclude = "attachmentData")
// @EqualsAndHashCode
// @Slf4j
// public class DefaultEmailAttachment implements EmailAttachment {
// 
//     private static final long serialVersionUID = -3307831714212032363L;
// 
//     @Getter
//     @NonNull
//     private String attachmentName;
// 
//     @Getter
//     @NonNull
//     private byte[] attachmentData;
// 
//     private MediaType mediaType;
// 
//     public MediaType getContentType() throws IOException {
//         final InputStream attachmentDataStream = new ByteArrayInputStream(attachmentData);
// 
//         final MediaType mediaType;
//         try {
//             mediaType = ofNullable(this.mediaType)
//                     .orElse(TikaDetector.tikaDetector().detect(attachmentDataStream, attachmentName));
//         } catch (IOException e) {
//             log.error("The MimeType is not set. Tried to guess it but something went wrong.", e);
//             throw e;
//         }
//         return mediaType;
//     }
// 
// }


import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.Locale;
import static org.junit.Assert.fail;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import it.ozimov.springboot.mail.UnitTest;
import it.ozimov.springboot.mail.model.defaultimpl.DefaultEmail;
import it.ozimov.springboot.mail.model.defaultimpl.DefaultEmailAttachment;
import org.assertj.core.api.JUnitSoftAssertions;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.internal.matchers.Null;
import org.springframework.http.MediaType;
import javax.mail.internet.InternetAddress;
                        .atZone(ZoneId.of("UTC"))
                        .toInstant()
        );

        emailWithOnlyMandatoryFields = DefaultEmail.builder()
                .from(new InternetAddress("from@email.com"))
                .to(ImmutableList.of(new InternetAddress("to_1@email.com"),
                        new InternetAddress("to_2@email.com")))
                .subject("subject")
                .body("body")
                .build();

        emailFullContent = DefaultEmail.builder()
                .from(new InternetAddress("from@email.com"))
                .to(ImmutableList.of(new InternetAddress("to_1@email.com"),
                        new InternetAddress("to_2@email.com")))
                .cc(ImmutableList.of(new InternetAddress("cc_1@email.com"),
                        new InternetAddress("cc_2@email.com")))
                .bcc(ImmutableList.of(new InternetAddress("bcc_1@email.com"),
                        new InternetAddress("bcc_2@email.com"),
                        new InternetAddress("bcc_3@email.com")))
                .replyTo(new InternetAddress("replyTo@email.com"))
                .receiptTo(new InternetAddress("receiptTo@email.com"))
                .depositionNotificationTo(new InternetAddress("depositionNotificationTo@email.com"))
                .encoding("UTF-16")
                .locale(Locale.ITALY)
                .sentAt(sentAt)
                .subject("subject")
                .body("body")
                .attachment(DefaultEmailAttachment.builder().attachmentName("attachment1.pdf").mediaType(MediaType.APPLICATION_PDF).attachmentData(new byte[]{}).build())
// Path: spring-boot-email-core/src/main/java/it/ozimov/springboot/mail/model/defaultimpl/DefaultEmailAttachment.java
// @NoArgsConstructor
// @RequiredArgsConstructor
// @AllArgsConstructor
// @Builder
// @ToString(exclude = "attachmentData")
// @EqualsAndHashCode
// @Slf4j
// public class DefaultEmailAttachment implements EmailAttachment {
// 
//     private static final long serialVersionUID = -3307831714212032363L;
// 
//     @Getter
//     @NonNull
//     private String attachmentName;
// 
//     @Getter
//     @NonNull
//     private byte[] attachmentData;
// 
//     private MediaType mediaType;
// 
//     public MediaType getContentType() throws IOException {
//         final InputStream attachmentDataStream = new ByteArrayInputStream(attachmentData);
// 
//         final MediaType mediaType;
//         try {
//             mediaType = ofNullable(this.mediaType)
//                     .orElse(TikaDetector.tikaDetector().detect(attachmentDataStream, attachmentName));
//         } catch (IOException e) {
//             log.error("The MimeType is not set. Tried to guess it but something went wrong.", e);
//             throw e;
//         }
//         return mediaType;
//     }
// 
// }


// Path: spring-boot-email-core/src/test/java/it/ozimov/springboot/mail/logging/defaultimpl/CustomizableEmailRendererTest.java
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.Locale;
import static org.junit.Assert.fail;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import it.ozimov.springboot.mail.UnitTest;
import it.ozimov.springboot.mail.model.defaultimpl.DefaultEmail;
import it.ozimov.springboot.mail.model.defaultimpl.DefaultEmailAttachment;
import org.assertj.core.api.JUnitSoftAssertions;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.internal.matchers.Null;
import org.springframework.http.MediaType;
import javax.mail.internet.InternetAddress;

                        .atZone(ZoneId.of("UTC"))
                        .toInstant()
        );

        emailWithOnlyMandatoryFields = DefaultEmail.builder()
                .from(new InternetAddress("from@email.com"))
                .to(ImmutableList.of(new InternetAddress("to_1@email.com"),
                        new InternetAddress("to_2@email.com")))
                .subject("subject")
                .body("body")
                .build();

        emailFullContent = DefaultEmail.builder()
                .from(new InternetAddress("from@email.com"))
                .to(ImmutableList.of(new InternetAddress("to_1@email.com"),
                        new InternetAddress("to_2@email.com")))
                .cc(ImmutableList.of(new InternetAddress("cc_1@email.com"),
                        new InternetAddress("cc_2@email.com")))
                .bcc(ImmutableList.of(new InternetAddress("bcc_1@email.com"),
                        new InternetAddress("bcc_2@email.com"),
                        new InternetAddress("bcc_3@email.com")))
                .replyTo(new InternetAddress("replyTo@email.com"))
                .receiptTo(new InternetAddress("receiptTo@email.com"))
                .depositionNotificationTo(new InternetAddress("depositionNotificationTo@email.com"))
                .encoding("UTF-16")
                .locale(Locale.ITALY)
                .sentAt(sentAt)
                .subject("subject")
                .body("body")
                .attachment(DefaultEmailAttachment.builder().attachmentName("attachment1.pdf").mediaType(MediaType.APPLICATION_PDF).attachmentData(new byte[]{}).build())
                .attachment(DefaultEmailAttachment.builder().attachmentName("attachment2.pdf").mediaType(MediaType.APPLICATION_PDF).attachmentData(new byte[]{}).build())