Skip to content

Commit

Permalink
Kotlinify test
Browse files Browse the repository at this point in the history
  • Loading branch information
afranken committed May 10, 2024
1 parent 0528566 commit f65b922
Showing 1 changed file with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ internal class AclIT : S3TestBase() {
assertThat(owner.displayName()).isEqualTo(DEFAULT_OWNER.displayName)
}

val grants = acl.grants().also {
acl.grants().also {
assertThat(it).hasSize(1)
}
val grant = grants[0]
assertThat(grant.permission()).isEqualTo(FULL_CONTROL)
grant.grantee().also {

acl.grants()[0].also {
assertThat(it.permission()).isEqualTo(FULL_CONTROL)
}.grantee().also {
assertThat(it).isNotNull
assertThat(it.id()).isEqualTo(DEFAULT_OWNER.id)
assertThat(it.displayName()).isEqualTo(DEFAULT_OWNER.displayName)
assertThat(it.type()).isEqualTo(CANONICAL_USER)
}
}


@Test
@S3VerifiedFailure(year = 2022,
reason = "Owner and Grantee not available on test AWS account.")
Expand Down Expand Up @@ -139,20 +139,21 @@ internal class AclIT : S3TestBase() {
.key(sourceKey)
.build()
)
val owner = acl.owner()
assertThat(owner).isNotNull
assertThat(owner.id()).isEqualTo(userId)
assertThat(owner.displayName()).isEqualTo(userName)
acl.owner().also {
assertThat(it).isNotNull
assertThat(it.id()).isEqualTo(userId)
assertThat(it.displayName()).isEqualTo(userName)
}

assertThat(acl.grants()).hasSize(1)

val grant = acl.grants()[0]
assertThat(grant.permission()).isEqualTo(FULL_CONTROL)

val grantee = grant.grantee()
assertThat(grantee).isNotNull
assertThat(grantee.id()).isEqualTo(granteeId)
assertThat(grantee.displayName()).isEqualTo(granteeName)
assertThat(grantee.type()).isEqualTo(CANONICAL_USER)
acl.grants()[0].also {
assertThat(it.permission()).isEqualTo(FULL_CONTROL)
}.grantee().also {
assertThat(it).isNotNull
assertThat(it.id()).isEqualTo(granteeId)
assertThat(it.displayName()).isEqualTo(granteeName)
assertThat(it.type()).isEqualTo(CANONICAL_USER)
}
}
}

0 comments on commit f65b922

Please sign in to comment.