forked from playframework/play-mailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: switch over dependencies to commons-email2 Jakarta
This addresses playframework#261 but is not yet ready for merging.
- Loading branch information
Showing
7 changed files
with
24 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
play-mailer/src/main/scala/play/api/libs/mailer/Attachment.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
play-mailer/src/main/scala/play/api/libs/mailer/SMTPMailer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package play.api.libs.mailer | ||
|
||
import java.io.File | ||
import javax.mail.Part | ||
|
||
import com.typesafe.config.{ Config, ConfigFactory } | ||
import org.apache.commons.mail.{ EmailConstants, HtmlEmail, MultiPartEmail } | ||
import jakarta.mail.Part | ||
import org.apache.commons.mail2.core.EmailConstants | ||
import org.apache.commons.mail2.jakarta.{ HtmlEmail, MultiPartEmail } | ||
import org.specs2.mutable._ | ||
|
||
import java.io.File | ||
|
||
class MailerPluginSpec extends Specification { | ||
|
||
object SimpleMailerClient extends MailerClient { | ||
|
@@ -18,8 +19,6 @@ class MailerPluginSpec extends Specification { | |
override def getContainer = super.getContainer | ||
} | ||
class MockHtmlEmail extends HtmlEmail { | ||
def getHtml = this.html | ||
def getText = this.text | ||
override def getPrimaryBodyPart = super.getPrimaryBodyPart | ||
override def getContainer = super.getContainer | ||
} | ||
|
@@ -67,8 +66,8 @@ class MailerPluginSpec extends Specification { | |
subject = "Subject", | ||
from = "John Doe <[email protected]>" | ||
)) | ||
email.getSocketTimeout mustEqual EmailConstants.SOCKET_TIMEOUT_MS | ||
email.getSocketConnectionTimeout mustEqual EmailConstants.SOCKET_TIMEOUT_MS | ||
email.getSocketTimeout mustEqual EmailConstants.SOCKET_TIMEOUT.toMillis.toInt | ||
email.getSocketConnectionTimeout mustEqual EmailConstants.SOCKET_TIMEOUT.toMillis.toInt | ||
} | ||
|
||
"configure the SMTP local host if configured" in { | ||
|