Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenani committed Dec 21, 2023
1 parent af4abc9 commit e5bb30b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ class EnrollE2EICertificateUseCaseTest {
arrangement.withCreateNewAccountResulting(Either.Right(RANDOM_NONCE))
arrangement.withCreateNewOrderResulting(Either.Right(Triple(ACME_ORDER, RANDOM_NONCE, RANDOM_LOCATION)))
arrangement.withCreateAuthzResulting(Either.Right(Triple(ACME_AUTHZ, RANDOM_NONCE, RANDOM_LOCATION)))
arrangement.withGettingRefreshTokenSucceeding()
arrangement.withGetWireNonceResulting(Either.Right(RANDOM_NONCE))
arrangement.withGetDPoPTokenResulting(Either.Right(RANDOM_DPoP_TOKEN))
arrangement.withGetWireAccessTokenResulting(Either.Right(WIRE_ACCESS_TOKEN))
Expand Down Expand Up @@ -977,7 +978,7 @@ class EnrollE2EICertificateUseCaseTest {
verify(arrangement.e2EIRepository)
.function(arrangement.e2EIRepository::nukeE2EIClient)
.with()
.wasInvoked(exactly = once)
.wasNotInvoked()
}

@Test
Expand All @@ -990,6 +991,7 @@ class EnrollE2EICertificateUseCaseTest {
arrangement.withCreateNewAccountResulting(Either.Right(RANDOM_NONCE))
arrangement.withCreateNewOrderResulting(Either.Right(Triple(ACME_ORDER, RANDOM_NONCE, RANDOM_LOCATION)))
arrangement.withCreateAuthzResulting(Either.Right(Triple(ACME_AUTHZ, RANDOM_NONCE, RANDOM_LOCATION)))
arrangement.withGettingRefreshTokenSucceeding()
arrangement.withGetWireNonceResulting(Either.Right(RANDOM_NONCE))
arrangement.withGetDPoPTokenResulting(Either.Right(RANDOM_DPoP_TOKEN))
arrangement.withGetWireAccessTokenResulting(Either.Right(WIRE_ACCESS_TOKEN))
Expand Down Expand Up @@ -1049,7 +1051,7 @@ class EnrollE2EICertificateUseCaseTest {
verify(arrangement.e2EIRepository)
.function(arrangement.e2EIRepository::nukeE2EIClient)
.with()
.wasInvoked(exactly = once)
.wasNotInvoked()
}

@Test
Expand Down Expand Up @@ -1233,6 +1235,13 @@ class EnrollE2EICertificateUseCaseTest {
.thenReturn(result)
}

fun withGettingRefreshTokenSucceeding() = apply {
given(e2EIRepository)
.suspendFunction(e2EIRepository::getOAuthRefreshToken)
.whenInvoked()
.thenReturn(Either.Right(" "))
}

fun arrange(): Pair<Arrangement, EnrollE2EIUseCase> = this to EnrollE2EIUseCaseImpl(e2EIRepository)
}

Expand Down

0 comments on commit e5bb30b

Please sign in to comment.