File tree 2 files changed +8
-5
lines changed
app/src/androidTest/java/com/mitteloupe/whoami/server
architecture/instrumentation-test/src/main/java/com/mitteloupe/whoami/test/server/response 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,14 @@ class AppResponseStore : ResponseStore() {
16
16
override val internalResponseFactories = listOf (
17
17
REQUEST_RESPONSE_GET_IP to MockRequestResponseFactory (
18
18
request = MockRequest (IPIFY_ENDPOINT ),
19
- responseFactory = SimpleResponseFactory (200 , " api/get_ip.json" )
19
+ responseFactory = SimpleResponseFactory (code = 200 , bodyFileName = " api/get_ip.json" )
20
20
),
21
21
REQUEST_RESPONSE_GET_IP_DETAILS to MockRequestResponseFactory (
22
22
request = MockRequest (" ${IPINFO_ENDPOINT }$IP_ADDRESS /geo" ),
23
- responseFactory = SimpleResponseFactory (200 , " api/get_ip_details.json" )
23
+ responseFactory = SimpleResponseFactory (
24
+ code = 200 ,
25
+ bodyFileName = " api/get_ip_details.json"
26
+ )
24
27
)
25
28
)
26
29
}
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import com.mitteloupe.whoami.test.server.MockResponse
5
5
6
6
data class SimpleResponseFactory (
7
7
private val code : Int = 200 ,
8
- private val bodyFileName : String = " " ,
9
- private val headers : List < Pair < String , String >> = emptyList()
8
+ private val headers : List < Pair < String , String >> = emptyList() ,
9
+ private val bodyFileName : String? = null
10
10
) : MockResponseFactory {
11
11
private val body by lazy {
12
- if (bodyFileName.isEmpty() ) {
12
+ if (bodyFileName == null ) {
13
13
" "
14
14
} else {
15
15
assetReader.getAssetAsString(bodyFileName)
You can’t perform that action at this time.
0 commit comments