Skip to content

Instantly share code, notes, and snippets.

@matzuk
Last active February 10, 2019 14:21
Show Gist options
  • Save matzuk/f674e912335923fa692c889eb4e187ba to your computer and use it in GitHub Desktop.
Save matzuk/f674e912335923fa692c889eb4e187ba to your computer and use it in GitHub Desktop.
// create implementation of ScannerFeatureDependencies
public class ScannerFeatureDependenciesFake implements ScannerFeatureDependencies {
@Override
public DbClientApi dbClient() {
return new DbClientFake();
}
@Override
public HttpClientApi httpClient() {
return new HttpClientFake();
}
@Override
public SomeUtils someUtils() {
return CoreUtilsComponent.get().someUtils();
}
@Override
public PurchaseInteractor purchaseInteractor() {
return new PurchaseInteractorFake();
}
}
// and initialize the graph somewhere in Application-file
public class ScannerExampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ScannerFeatureComponent.initAndGet(
// да, Даггер отлично съедает это =)
new ScannerFeatureDependenciesFake()
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment