Search in sources :

Example 1 with NetworkBehavior

use of retrofit.mock.NetworkBehavior in project sbt-android by scala-android.

the class DebugApiModule method provideBehavior.

@Provides
@Singleton
NetworkBehavior provideBehavior(@NetworkDelay Preference<Long> networkDelay, @NetworkFailurePercent Preference<Integer> networkFailurePercent, @NetworkVariancePercent Preference<Integer> networkVariancePercent) {
    NetworkBehavior behavior = NetworkBehavior.create();
    behavior.setDelay(networkDelay.get(), MILLISECONDS);
    behavior.setFailurePercent(networkFailurePercent.get());
    behavior.setVariancePercent(networkVariancePercent.get());
    return behavior;
}
Also used : NetworkBehavior(retrofit.mock.NetworkBehavior) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

Provides (dagger.Provides)1 Singleton (javax.inject.Singleton)1 NetworkBehavior (retrofit.mock.NetworkBehavior)1