Skip to content

Commit

Permalink
#71 https test disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 26, 2023
1 parent b5ca8f4 commit 7b72baa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
13 changes: 3 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,9 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.5.0-b01</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
<version>1.4.3</version>
<scope>provided</scope>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>com.icegreen</groupId>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/jcabi/email/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ public Map<String, String> entries() {
.put("mail.smtps.auth", Boolean.TRUE.toString())
.put("mail.smtps.host", this.host)
.put("mail.smtps.port", Integer.toString(this.port))
.put("mail.smtp.starttls.required", "true")
.put("mail.smtp.ssl.protocols", "TLSv1.2")
.put("mail.smtp.starttls.enable", "true")
.put(
"mail.smtp.ssl.checkserveridentity",
Boolean.TRUE.toString()
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/com/jcabi/email/wire/SmtpsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import javax.mail.internet.MimeMessage;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -61,12 +62,12 @@ final class SmtpsTest {
* @throws Exception If fails
*/
@Test
@Disabled
void sendsEmailToTheServerThroughSmtps() throws Exception {
final String bind = "localhost";
final int received = 1;
final int port = SmtpsTest.port();
final int timeout = 3000;
System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");
Security.setProperty(
"ssl.SocketFactory.provider",
DummySSLSocketFactory.class.getName()
Expand All @@ -80,8 +81,12 @@ void sendsEmailToTheServerThroughSmtps() throws Exception {
try {
new Postman.Default(
new Smtps(
new Token("", "")
.access(new Protocol.Smtps(bind, port))
new Token("", "").access(
new Protocol.Smtps(
server.getSmtps().getBindTo(),
server.getSmtps().getPort()
)
)
)
).send(
new Envelope.Safe(
Expand Down

0 comments on commit 7b72baa

Please sign in to comment.