Simplify error handling
This commit is contained in:
@@ -71,7 +71,7 @@ class AuthDataSourceImplTest {
|
||||
|
||||
@Test(expected = MalformedUrl::class)
|
||||
fun `when authenticate and provideService throws then MalformedUrl`() = runTest {
|
||||
coEvery { authServiceFactory.provideService() } throws RuntimeException()
|
||||
coEvery { authServiceFactory.provideService() } throws MalformedUrl(RuntimeException())
|
||||
callAuthenticate()
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ class VersionDataSourceImplTest {
|
||||
|
||||
@Test(expected = NetworkError.MalformedUrl::class)
|
||||
fun `when getVersionInfo and provideService throws then MalformedUrl`() = runTest {
|
||||
coEvery { versionServiceFactory.provideService(eq(TEST_BASE_URL)) } throws RuntimeException()
|
||||
coEvery {
|
||||
versionServiceFactory.provideService(eq(TEST_BASE_URL))
|
||||
} throws NetworkError.MalformedUrl(RuntimeException())
|
||||
subject.getVersionInfo(TEST_BASE_URL)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user