import java.io.IOException;
import java.net.MalformedURLException;
+import java.nio.file.Path;
import java.util.Map;
import javax.mail.MessagingException;
public void withURLAttachmentReturnsMultiPartEmail()
throws AddressException, EmailException, MalformedURLException {
MailBuilder builder = new MailBuilder(TEST_EMAIL);
- Email mail = builder.withText("boo").withURLAttachment("http://www.openhab.org").build();
+ String url = Path.of("src/test/resources/attachment.txt").toUri().toURL().toString();
+ Email mail = builder.withText("boo").withURLAttachment(url).build();
assertThat(mail, instanceOf(MultiPartEmail.class));
}