Skip to content

Commit b3e1dad

Browse files
committed
Fix withArg usage in AutoSignInUseCaseTest
1 parent fc92a65 commit b3e1dad

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

aws-auth-cognito/src/test/java/com/amplifyframework/auth/cognito/usecases/AutoSignInUseCaseTest.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.amplifyframework.statemachine.codegen.states.AuthorizationState
2828
import com.amplifyframework.statemachine.codegen.states.SignUpState
2929
import io.kotest.assertions.throwables.shouldThrow
3030
import io.kotest.matchers.shouldBe
31+
import io.kotest.matchers.types.shouldBeInstanceOf
3132
import io.mockk.every
3233
import io.mockk.justRun
3334
import io.mockk.mockk
@@ -95,7 +96,10 @@ class AutoSignInUseCaseTest {
9596

9697
verify {
9798
stateMachine.send(
98-
withArg { it is AuthenticationEvent && it.eventType is AuthenticationEvent.EventType.CancelSignIn }
99+
withArg {
100+
it.shouldBeInstanceOf<AuthenticationEvent>()
101+
it.eventType.shouldBeInstanceOf<AuthenticationEvent.EventType.CancelSignIn>()
102+
}
99103
)
100104
}
101105
}
@@ -112,7 +116,10 @@ class AutoSignInUseCaseTest {
112116

113117
verify {
114118
stateMachine.send(
115-
withArg { it is AuthenticationEvent && it.eventType is AuthenticationEvent.EventType.SignInRequested }
119+
withArg {
120+
it.shouldBeInstanceOf<AuthenticationEvent>()
121+
it.eventType.shouldBeInstanceOf<AuthenticationEvent.EventType.SignInRequested>()
122+
}
116123
)
117124
}
118125
}

0 commit comments

Comments
 (0)