Search in sources :

Example 1 with MockFeedItemFactory

use of com.meniga.sdk.helpers.MockFeedItemFactory in project mobile-sdk-android by meniga.

the class MockClient method getApi.

public static MenigaAPI getApi(Interceptor myInterceptor) {
    OkHttpClient client = new OkHttpClient.Builder().addInterceptor(myInterceptor).build();
    final Retrofit retrofit = new Retrofit.Builder().addConverterFactory(new MenigaTransactionsConverter()).addConverterFactory(new MenigaFeedConverter(new MockFeedItemFactory())).addConverterFactory(new MenigaCategoryConverter()).addConverterFactory(new MenigaOfferConverter()).addConverterFactory(new MenigaRedemptionConverter()).addConverterFactory(new MenigaReimbursementAccountConverter()).addConverterFactory(new MenigaIdNameKeyValConverter()).addConverterFactory(new MenigaChallengesConverter(new ChallengeItemFactory())).addConverterFactory(new MenigaFeedItemConverter(new MockFeedItemFactory())).addConverterFactory(new MenigaBaseConverter()).addConverterFactory(GsonConverterFactory.create()).baseUrl("http://meniga.is/api/").client(client).build();
    return retrofit.create(MenigaAPI.class);
}
Also used : OkHttpClient(okhttp3.OkHttpClient) MenigaFeedItemConverter(com.meniga.sdk.converters.MenigaFeedItemConverter) MenigaIdNameKeyValConverter(com.meniga.sdk.converters.MenigaIdNameKeyValConverter) MenigaFeedConverter(com.meniga.sdk.converters.MenigaFeedConverter) MenigaTransactionsConverter(com.meniga.sdk.converters.MenigaTransactionsConverter) MenigaReimbursementAccountConverter(com.meniga.sdk.converters.MenigaReimbursementAccountConverter) ChallengeItemFactory(com.meniga.sdk.helpers.ChallengeItemFactory) MockFeedItemFactory(com.meniga.sdk.helpers.MockFeedItemFactory) Retrofit(retrofit2.Retrofit) MenigaChallengesConverter(com.meniga.sdk.converters.MenigaChallengesConverter) MenigaBaseConverter(com.meniga.sdk.converters.MenigaBaseConverter) MenigaOfferConverter(com.meniga.sdk.converters.MenigaOfferConverter) MenigaCategoryConverter(com.meniga.sdk.converters.MenigaCategoryConverter) MenigaRedemptionConverter(com.meniga.sdk.converters.MenigaRedemptionConverter)

Aggregations

MenigaBaseConverter (com.meniga.sdk.converters.MenigaBaseConverter)1 MenigaCategoryConverter (com.meniga.sdk.converters.MenigaCategoryConverter)1 MenigaChallengesConverter (com.meniga.sdk.converters.MenigaChallengesConverter)1 MenigaFeedConverter (com.meniga.sdk.converters.MenigaFeedConverter)1 MenigaFeedItemConverter (com.meniga.sdk.converters.MenigaFeedItemConverter)1 MenigaIdNameKeyValConverter (com.meniga.sdk.converters.MenigaIdNameKeyValConverter)1 MenigaOfferConverter (com.meniga.sdk.converters.MenigaOfferConverter)1 MenigaRedemptionConverter (com.meniga.sdk.converters.MenigaRedemptionConverter)1 MenigaReimbursementAccountConverter (com.meniga.sdk.converters.MenigaReimbursementAccountConverter)1 MenigaTransactionsConverter (com.meniga.sdk.converters.MenigaTransactionsConverter)1 ChallengeItemFactory (com.meniga.sdk.helpers.ChallengeItemFactory)1 MockFeedItemFactory (com.meniga.sdk.helpers.MockFeedItemFactory)1 OkHttpClient (okhttp3.OkHttpClient)1 Retrofit (retrofit2.Retrofit)1