Skip to content

Commit 43030a0

Browse files
authored
Renamed UnhandledDestinationException to UnhandledNavigationException. (#402)
1 parent 1c8d8db commit 43030a0

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

app/src/androidTest/java/com/mitteloupe/whoami/test/HistoryTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

app/src/main/java/com/mitteloupe/whoami/navigation/mapper/HistoryNavigationEventDestinationMapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.mitteloupe.whoami.navigation.mapper
22

33
import com.mitteloupe.whoami.architecture.presentation.navigation.PresentationNavigationEvent
44
import 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
66
import com.mitteloupe.whoami.architecture.ui.navigation.mapper.NavigationEventDestinationMapper
77
import 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 ->

app/src/test/java/com/mitteloupe/whoami/navigation/mapper/HomeNavigationEventDestinationMapperTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import androidx.navigation.NavController
66
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
77
import com.mitteloupe.whoami.analytics.Analytics
88
import 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
1010
import com.mitteloupe.whoami.home.presentation.navigation.HomePresentationNavigationEvent.OnSavedDetails
1111
import com.mitteloupe.whoami.home.presentation.navigation.HomePresentationNavigationEvent.OnViewHistory
1212
import 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
)

architecture/ui/src/main/java/com/mitteloupe/whoami/architecture/ui/navigation/exception/UnhandledDestinationException.kt renamed to architecture/ui/src/main/java/com/mitteloupe/whoami/architecture/ui/navigation/exception/UnhandledNavigationException.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.mitteloupe.whoami.architecture.ui.navigation.exception
22

33
import 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
)

architecture/ui/src/main/java/com/mitteloupe/whoami/architecture/ui/navigation/mapper/NavigationEventDestinationMapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.mitteloupe.whoami.architecture.ui.navigation.mapper
22

33
import 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
55
import com.mitteloupe.whoami.architecture.ui.navigation.model.UiDestination
66
import 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
}

0 commit comments

Comments
 (0)