Skip to content

Commit

Permalink
Update docs to configure flaker for custom fail response
Browse files Browse the repository at this point in the history
  • Loading branch information
RotBolt committed Oct 11, 2023
1 parent 330f8ef commit 14ee3b8
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add the following dependency to your `build.gradle`
}
```

#### flaker-android-okhttp
### flaker-android-okhttp
Add the following statement to your app's onCreate method.
```kotlin
class MainApplication: Application() {
Expand All @@ -43,10 +43,28 @@ Then in your okhttp client builder, add the following interceptor.
```
That's it. Now upon installing your app, a companion app `flaker` will be installed on your device. You can use this app to configure the network conditions for your app.

#### flaker-android-ktor
#### Configuration

You can configure the following parameters in the `FlakerInterceptor`.

- Failure Response by Flaker

```kotlin
val flakerFailResponse = FlakerFailResponse(
httpCode = 500,
message = "Flaker is enabled. This is a flaky response.",
responseBodyString = "Test Failure"
)
val flakerInterceptor = FlakerInterceptor.Builder()
.failResponse(flakerFailResponse)
.build()
```


### flaker-android-ktor
In progress

#### flaker-ios-ktor (In Progress)
### flaker-ios-ktor (In Progress)
In progress

## Releases
Expand Down

0 comments on commit 14ee3b8

Please sign in to comment.