-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/sierra_adapter/sierra_progres…
…s_reporter/urllib3-1.26.19
- Loading branch information
Showing
6 changed files
with
91 additions
and
24 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
55 changes: 55 additions & 0 deletions
55
common/lambda/src/test/scala/weco/lambda/DownstreamTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package weco.lambda | ||
|
||
import org.scalatest.funspec.AnyFunSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import weco.lambda.helpers.ConfigurationTestHelpers | ||
import weco.messaging.sns.SNSConfig | ||
|
||
class DownstreamTest extends AnyFunSpec | ||
with ConfigurationTestHelpers | ||
with Matchers { | ||
|
||
describe("DownstreamBuilder") { | ||
it("builds a StdOut downstream target") { | ||
val config = | ||
""" | ||
|downstream.target = "stdio" | ||
|""".asConfig | ||
|
||
DownstreamBuilder.buildDownstreamTarget(config) shouldBe StdOut | ||
} | ||
|
||
it("builds an SNS downstream target") { | ||
val config = | ||
""" | ||
|downstream.target = "sns" | ||
|aws.sns.topic.arn = "arn:aws:sns:eu-west-1:123456789012:my-topic" | ||
|""".asConfig | ||
|
||
DownstreamBuilder.buildDownstreamTarget(config) shouldBe SNS( | ||
config = SNSConfig( | ||
topicArn = "arn:aws:sns:eu-west-1:123456789012:my-topic" | ||
) | ||
) | ||
} | ||
|
||
it("builds a StdOut downstream target if no downstream target is specified") { | ||
val config = | ||
""" | ||
|""".asConfig | ||
|
||
DownstreamBuilder.buildDownstreamTarget(config) shouldBe StdOut | ||
} | ||
|
||
it("throws an exception if the downstream target is not recognised") { | ||
val config = | ||
""" | ||
|downstream.target = "invalid" | ||
|""".asConfig | ||
|
||
intercept[IllegalArgumentException] { | ||
DownstreamBuilder.buildDownstreamTarget(config) | ||
} | ||
} | ||
} | ||
} |
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
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