-
Notifications
You must be signed in to change notification settings - Fork 17
/
StartStreamEncryptionTests.scala
37 lines (32 loc) · 1.04 KB
/
StartStreamEncryptionTests.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package kinesis.mock
import scala.concurrent.duration._
import cats.effect.IO
import software.amazon.awssdk.services.kinesis.model._
import kinesis.mock.instances.arbitrary._
import kinesis.mock.syntax.javaFuture._
import kinesis.mock.syntax.scalacheck._
class StartStreamEncryptionTests extends AwsFunctionalTests {
fixture.test("It should start stream encryption") { resources =>
for {
keyId <- IO(keyIdGen.one)
_ <- resources.kinesisClient
.startStreamEncryption(
StartStreamEncryptionRequest
.builder()
.streamName(resources.streamName.streamName)
.keyId(keyId)
.encryptionType(EncryptionType.KMS)
.build()
)
.toIO
_ <- IO.sleep(
resources.cacheConfig.startStreamEncryptionDuration.plus(400.millis)
)
res <- describeStreamSummary(resources)
} yield assert(
res.streamDescriptionSummary().keyId() == keyId &&
res.streamDescriptionSummary().encryptionType() == EncryptionType.KMS,
res
)
}
}