-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update mock web server and fix demo app (#22)
- Loading branch information
1 parent
4d0c817
commit 3c26f86
Showing
3 changed files
with
5 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
package com.telefonica.mocks.domain.mock | ||
|
||
import com.squareup.moshi.Moshi | ||
import com.telefonica.mock.Method | ||
import com.telefonica.mock.MockedApiResponse | ||
import com.telefonica.mock.MockHelper | ||
import com.telefonica.mocks.model.user.NameDto | ||
import com.telefonica.mocks.model.user.UserDto | ||
import com.telefonica.mocks.model.user.UserWrapperDto | ||
import javax.inject.Inject | ||
|
||
open class GetUserMocksUseCase @Inject constructor( | ||
|
@@ -15,85 +9,9 @@ open class GetUserMocksUseCase @Inject constructor( | |
|
||
operator fun invoke() { | ||
mockHelper.enqueue { | ||
whenever("/image.png").thenReturnFromRawFile("demo_image") | ||
whenever("/?results=5").thenReturnFromFile("user_list_success_1.json") | ||
whenever(".*/?results=5").thenReturnFromFile("user_list_success_1.json") | ||
whenever(".*/?results=10").thenReturnFromFile("user_list_success_2.json") | ||
} | ||
} | ||
|
||
companion object { | ||
val DEMO_LIST = UserWrapperDto( | ||
results = listOf( | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Pablo", last = "Garcia" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 11" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "David", last = "Santiago" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 12" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "David", last = "Pastor" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 13" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Pablo", last = "Martin" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 14" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Yamal", last = "Al-Mahamid" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 15" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "David", last = "Gonzalez" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 16" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Jesus", last = "Latorre" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 17" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Guillermo", last = "Merino" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 18" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Manolo", last = "Vera" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 19" | ||
), | ||
UserDto( | ||
name = NameDto( | ||
title = "Sr", first = "Javier", last = "Delgado" | ||
), | ||
email = "[email protected]", | ||
phone = "611 11 11 10" | ||
), | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters