Search in sources :

Example 1 with DefaultSubscriptionCatalogApi

use of org.killbill.billing.subscription.catalog.DefaultSubscriptionCatalogApi in project killbill by killbill.

the class TestDefaultSubscriptionTransferApi method beforeMethod.

@Override
@BeforeMethod(groups = "fast")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    final SubscriptionDao dao = Mockito.mock(SubscriptionDao.class);
    final DefaultVersionedCatalog versionedCatalog = new DefaultVersionedCatalog();
    final MockCatalog mockCatalog = new MockCatalog();
    versionedCatalog.add(mockCatalog);
    final CatalogService catalogService = new MockCatalogService(versionedCatalog);
    final CatalogInternalApi catalogInternalApiWithMockCatalogService = new DefaultCatalogInternalApi(catalogService);
    final SubscriptionCatalogApi subscriptionCatalogInternalApiWithMockCatalogService = new DefaultSubscriptionCatalogApi(catalogInternalApiWithMockCatalogService, clock);
    final SubscriptionBaseApiService apiService = Mockito.mock(SubscriptionBaseApiService.class);
    final SubscriptionBaseTimelineApi timelineApi = Mockito.mock(SubscriptionBaseTimelineApi.class);
    transferApi = new DefaultSubscriptionBaseTransferApi(clock, dao, timelineApi, subscriptionCatalogInternalApiWithMockCatalogService, subscriptionInternalApi, apiService, internalCallContextFactory);
    // Overrride catalog with our MockCatalog
    this.catalog = DefaultSubscriptionCatalogApi.wrapCatalog(versionedCatalog, clock);
}
Also used : DefaultCatalogInternalApi(org.killbill.billing.catalog.api.DefaultCatalogInternalApi) CatalogInternalApi(org.killbill.billing.catalog.api.CatalogInternalApi) DefaultSubscriptionCatalogApi(org.killbill.billing.subscription.catalog.DefaultSubscriptionCatalogApi) SubscriptionCatalogApi(org.killbill.billing.subscription.catalog.SubscriptionCatalogApi) MockCatalog(org.killbill.billing.catalog.MockCatalog) DefaultSubscriptionCatalogApi(org.killbill.billing.subscription.catalog.DefaultSubscriptionCatalogApi) SubscriptionBaseTimelineApi(org.killbill.billing.subscription.api.timeline.SubscriptionBaseTimelineApi) MockCatalogService(org.killbill.billing.catalog.MockCatalogService) CatalogService(org.killbill.billing.catalog.api.CatalogService) SubscriptionBaseApiService(org.killbill.billing.subscription.api.SubscriptionBaseApiService) SubscriptionDao(org.killbill.billing.subscription.engine.dao.SubscriptionDao) DefaultVersionedCatalog(org.killbill.billing.catalog.DefaultVersionedCatalog) MockCatalogService(org.killbill.billing.catalog.MockCatalogService) DefaultCatalogInternalApi(org.killbill.billing.catalog.api.DefaultCatalogInternalApi) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

DefaultVersionedCatalog (org.killbill.billing.catalog.DefaultVersionedCatalog)1 MockCatalog (org.killbill.billing.catalog.MockCatalog)1 MockCatalogService (org.killbill.billing.catalog.MockCatalogService)1 CatalogInternalApi (org.killbill.billing.catalog.api.CatalogInternalApi)1 CatalogService (org.killbill.billing.catalog.api.CatalogService)1 DefaultCatalogInternalApi (org.killbill.billing.catalog.api.DefaultCatalogInternalApi)1 SubscriptionBaseApiService (org.killbill.billing.subscription.api.SubscriptionBaseApiService)1 SubscriptionBaseTimelineApi (org.killbill.billing.subscription.api.timeline.SubscriptionBaseTimelineApi)1 DefaultSubscriptionCatalogApi (org.killbill.billing.subscription.catalog.DefaultSubscriptionCatalogApi)1 SubscriptionCatalogApi (org.killbill.billing.subscription.catalog.SubscriptionCatalogApi)1 SubscriptionDao (org.killbill.billing.subscription.engine.dao.SubscriptionDao)1 BeforeMethod (org.testng.annotations.BeforeMethod)1