File tree Expand file tree Collapse file tree
androidTest/java/com/mitteloupe/whoami/test
main/java/com/mitteloupe/whoami/navigation/mapper
test/java/com/mitteloupe/whoami/navigation/mapper
architecture/ui/src/main/java/com/mitteloupe/whoami/architecture/ui/navigation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ class HistoryTest : BaseTest() {
7979 @LocalStore(
8080 localStoreDataIds = [KEY_VALUE_NO_HISTORY ]
8181 )
82- fun givenNoHistoryWhenOnHistoryScreenThenSeesHistory () {
82+ fun givenNoHistoryWhenOnHistoryScreenThenSeesNoRecords () {
8383 with (historyScreen) {
84- seeNoRecordsLabel()
84+ retry(repeat = 20 ) {
85+ seeNoRecordsLabel()
86+ }
8587 }
8688 }
8789
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package com.mitteloupe.whoami.navigation.mapper
22
33import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent
44import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent.Back
5- import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledDestinationException
5+ import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledNavigationException
66import com.mitteloupe.whoami.architecture.ui.navigation.mapper.NavigationEventDestinationMapper
77import com.mitteloupe.whoami.architecture.ui.navigation.model.UiDestination
88
@@ -13,7 +13,7 @@ class HistoryNavigationEventDestinationMapper :
1313 override fun mapTypedEvent (navigationEvent : PresentationNavigationEvent ): UiDestination =
1414 when (navigationEvent) {
1515 is Back -> backUiDestination()
16- else -> throw UnhandledDestinationException (navigationEvent)
16+ else -> throw UnhandledNavigationException (navigationEvent)
1717 }
1818
1919 private fun backUiDestination () = UiDestination { navController ->
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import androidx.navigation.NavController
66import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
77import com.mitteloupe.whoami.analytics.Analytics
88import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent
9- import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledDestinationException
9+ import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledNavigationException
1010import com.mitteloupe.whoami.home.presentation.navigation.HomePresentationNavigationEvent.OnSavedDetails
1111import com.mitteloupe.whoami.home.presentation.navigation.HomePresentationNavigationEvent.OnViewHistory
1212import com.mitteloupe.whoami.home.presentation.navigation.HomePresentationNavigationEvent.OnViewOpenSourceNotices
@@ -115,12 +115,12 @@ class HomeNavigationEventDestinationMapperTest {
115115 val actualException = requireNotNull(caughtException)
116116 assertThat(
117117 actualException,
118- isA(UnhandledDestinationException ::class .java)
118+ isA(UnhandledNavigationException ::class .java)
119119 )
120120 assertThat(
121121 actualException.message,
122122 matchesPattern(
123- " ^Navigation to PresentationNavigationEvent\\ \$ MockitoMock\\ \$ \\ w+ " +
123+ " ^Navigation event PresentationNavigationEvent\\ \$ MockitoMock\\ \$ \\ w+ " +
124124 " was not handled.$"
125125 )
126126 )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package com.mitteloupe.whoami.architecture.ui.navigation.exception
22
33import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent
44
5- class UnhandledDestinationException ( destination : PresentationNavigationEvent ) :
5+ class UnhandledNavigationException ( event : PresentationNavigationEvent ) :
66 IllegalArgumentException (
7- " Navigation to ${destination ::class .simpleName} was not handled."
7+ " Navigation event ${event ::class .simpleName} was not handled."
88 )
Original file line number Diff line number Diff line change 11package com.mitteloupe.whoami.architecture.ui.navigation.mapper
22
33import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent
4- import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledDestinationException
4+ import com.mitteloupe.whoami.architecture.ui.navigation.exception.UnhandledNavigationException
55import com.mitteloupe.whoami.architecture.ui.navigation.model.UiDestination
66import kotlin.reflect.KClass
77
@@ -15,7 +15,7 @@ abstract class NavigationEventDestinationMapper<in EVENT : PresentationNavigatio
1515 }
1616
1717 else -> {
18- mapGenericEvent(navigationEvent) ? : throw UnhandledDestinationException (
18+ mapGenericEvent(navigationEvent) ? : throw UnhandledNavigationException (
1919 navigationEvent
2020 )
2121 }
You can’t perform that action at this time.
0 commit comments