-
Notifications
You must be signed in to change notification settings - Fork 17
/
StopStreamEncryptionTests.scala
49 lines (44 loc) · 1.37 KB
/
StopStreamEncryptionTests.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
38
39
40
41
42
43
44
45
46
47
48
49
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 StopStreamEncryptionTests extends AwsFunctionalTests {
fixture.test("It should stop 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)
)
_ <- resources.kinesisClient
.stopStreamEncryption(
StopStreamEncryptionRequest
.builder()
.streamName(resources.streamName.streamName)
.keyId(keyId)
.encryptionType(EncryptionType.KMS)
.build()
)
.toIO
_ <- IO.sleep(
resources.cacheConfig.stopStreamEncryptionDuration.plus(400.millis)
)
res <- describeStreamSummary(resources)
} yield assert(
res.streamDescriptionSummary().keyId() == null, // scalafix:ok
res
)
}
}