Last active
February 10, 2019 14:21
-
-
Save matzuk/f674e912335923fa692c889eb4e187ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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