• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash-android / 10075269522

24 Jul 2024 10:50AM UTC coverage: 69.676% (+4.4%) from 65.26%
10075269522

Pull #64

github

web-flow
Merge edfc3794f into 4fb5c6315
Pull Request #64: tests: test metrics sender

178 of 280 branches covered (63.57%)

Branch coverage included in aggregate %.

532 of 739 relevant lines covered (71.99%)

4.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.75
/unleashandroidsdk/src/main/java/io/getunleash/android/http/ClientBuilder.kt
1
package io.getunleash.android.http
2

3
import android.content.Context
4
import io.getunleash.android.UnleashConfig
5
import io.getunleash.android.cache.CacheDirectoryProvider
6
import io.getunleash.android.data.DataStrategy
7
import okhttp3.Cache
8
import okhttp3.OkHttpClient
9
import java.util.concurrent.TimeUnit
10

11
class ClientBuilder(private val unleashConfig: UnleashConfig, private val androidContext: Context) {
9✔
12
    fun build(
13
        clientName: String,
14
        strategy: DataStrategy
15
    ): OkHttpClient {
16
        val builder = OkHttpClient.Builder()
4✔
17
            .readTimeout(strategy.httpReadTimeout, TimeUnit.MILLISECONDS)
4✔
18
            .connectTimeout(strategy.httpConnectionTimeout, TimeUnit.MILLISECONDS)
4✔
19
        if (unleashConfig.localStorageConfig.enabled) {
5!
20
            builder.cache(
×
21
                Cache(
×
22
                    directory = CacheDirectoryProvider(
×
23
                        unleashConfig.localStorageConfig,
×
24
                        androidContext
×
25
                    ).getCacheDirectory(
×
26
                        "unleash_${clientName}_http_cache", true
×
27
                    ),
28
                    maxSize = strategy.httpCacheSize
×
29
                )
30
            )
31
        }
32
        return builder.build()
3✔
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc