Skip to content

Commit

Permalink
Update AuthenticationActivityTest.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
poovamraj committed Jul 31, 2023
1 parent d89256a commit b9ad3f5
Showing 1 changed file with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class AuthenticationActivityTest {
@Captor
private lateinit var launchAsTwaCaptor: ArgumentCaptor<Boolean>

@Captor
private lateinit var failureCallbackCaptor: ArgumentCaptor<RunnableTask<AuthenticationException>>

private lateinit var callerActivity: Activity
private lateinit var activity: AuthenticationActivityMock
private lateinit var activityController: ActivityController<AuthenticationActivityMock>
Expand Down Expand Up @@ -88,11 +91,7 @@ public class AuthenticationActivityTest {
createActivity(intentCaptor.value)
activityController.create().start().resume()
Mockito.verify(customTabsController).bindService()
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), object :
RunnableTask<AuthenticationException> {
override fun apply(error: AuthenticationException) {
}
})
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), failureCallbackCaptor.capture())
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(Matchers.notNullValue()))
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(uri))
MatcherAssert.assertThat(activity.deliveredIntent, Is.`is`(Matchers.nullValue()))
Expand Down Expand Up @@ -123,11 +122,7 @@ public class AuthenticationActivityTest {
createActivity(intentCaptor.value)
activityController.create().start().resume()
Mockito.verify(customTabsController).bindService()
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), object :
RunnableTask<AuthenticationException> {
override fun apply(error: AuthenticationException) {
}
})
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), failureCallbackCaptor.capture())
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(Matchers.notNullValue()))
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(uri))
MatcherAssert.assertThat(activity.deliveredIntent, Is.`is`(Matchers.nullValue()))
Expand Down Expand Up @@ -158,11 +153,7 @@ public class AuthenticationActivityTest {
createActivity(intentCaptor.value)
activityController.create().start().resume()
Mockito.verify(customTabsController).bindService()
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), object :
RunnableTask<AuthenticationException> {
override fun apply(error: AuthenticationException) {
}
})
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), failureCallbackCaptor.capture())
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(Matchers.notNullValue()))
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(uri))
MatcherAssert.assertThat(launchAsTwaCaptor.value, Is.`is`(Matchers.notNullValue()))
Expand Down Expand Up @@ -192,11 +183,7 @@ public class AuthenticationActivityTest {
createActivity(intentCaptor.value)
activityController.create().start().resume()
Mockito.verify(customTabsController).bindService()
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), object :
RunnableTask<AuthenticationException> {
override fun apply(error: AuthenticationException) {
}
})
Mockito.verify(customTabsController).launchUri(uriCaptor.capture(), launchAsTwaCaptor.capture(), failureCallbackCaptor.capture())
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(Matchers.notNullValue()))
MatcherAssert.assertThat(uriCaptor.value, Is.`is`(uri))
MatcherAssert.assertThat(launchAsTwaCaptor.value, Is.`is`(Matchers.notNullValue()))
Expand Down

0 comments on commit b9ad3f5

Please sign in to comment.