Skip to content

Commit

Permalink
Add trusted cert to the github action jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
minosiants committed Jun 21, 2023
1 parent c6e6c46 commit 6903e7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'
java-version: 17
- name: Import cert
run: keytool -import -trustcacerts -keystore /opt/hostedtoolcache/Java_Zulu_jdk/17.0.7-7/x64/lib/security/cacerts -storepass changeit -noprompt -alias pencil -file src/test/resources/certs/certificate.crt
- name: Run tests
run: sbt +test

Expand Down
12 changes: 5 additions & 7 deletions src/test/scala/pencil/SendEmailSpec.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
package pencil

import cats.effect.IO
Expand All @@ -20,13 +19,13 @@ class SendEmailSpec extends MailServerSpec {
sequential
"email" should {
"send mime email" in {
val email = SmtpSpec2.mimeEmail
val email = SendEmailSpec.mimeEmail2
val message = EmberClientBuilder
.default[IO]
.build
.use { httpClient =>
for
_ <- sendEmail(SendEmailSpec.mimeEmail)
_ <- sendEmail(SendEmailSpec.mimeEmail2)
messages <- httpClient.expect[Messages](
s"""http://localhost:${container.httpPort}/api/v1/messages"""
)
Expand All @@ -45,7 +44,7 @@ class SendEmailSpec extends MailServerSpec {
message.From.Address ==== email.from.address
Name(message.From.Name) ==== email.from.mailbox.name.get
message.Subject ==== email.subject.get.asString
message.Text ==== email.body.flatMap(_.body).get
message.Text.trim ==== email.body.flatMap(_.body).get
}
// Pending("this is integration test")
}
Expand Down Expand Up @@ -103,7 +102,6 @@ object SendEmailSpec extends LiteralsSyntax:
from"kaspar minosyants<user1@mydomain.tld>",
to"pencil <pencil@mail.pencil.com>",
subject"привет",
Body.Ascii("hi there2"),
List(attachment"/home/kaspar/stuff/sources/pencil/src/test/resources/files/jpeg-sample.jpg")
Body.Ascii("hi there2")
// List(attachment"/home/kaspar/stuff/sources/pencil/src/test/resources/files/jpeg-sample.jpg")
)
*/

0 comments on commit 6903e7f

Please sign in to comment.