Search in sources :

Example 1 with CatalogService

use of org.killbill.billing.catalog.api.CatalogService in project killbill by killbill.

the class TestDefaultSubscriptionTransferApi method beforeMethod.

@Override
@BeforeMethod(groups = "fast")
public void beforeMethod() throws Exception {
    super.beforeMethod();
    final NonEntityDao nonEntityDao = Mockito.mock(NonEntityDao.class);
    final SubscriptionDao dao = Mockito.mock(SubscriptionDao.class);
    final CatalogService catalogService = new MockCatalogService(new MockCatalog(), cacheControllerDispatcher);
    final SubscriptionBaseApiService apiService = Mockito.mock(SubscriptionBaseApiService.class);
    final SubscriptionBaseTimelineApi timelineApi = Mockito.mock(SubscriptionBaseTimelineApi.class);
    transferApi = new DefaultSubscriptionBaseTransferApi(clock, dao, timelineApi, catalogService, apiService, internalCallContextFactory);
}
Also used : MockCatalog(org.killbill.billing.catalog.MockCatalog) NonEntityDao(org.killbill.billing.util.dao.NonEntityDao) 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) MockCatalogService(org.killbill.billing.catalog.MockCatalogService) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with CatalogService

use of org.killbill.billing.catalog.api.CatalogService in project killbill by killbill.

the class MockCatalogModule method configure.

@Override
protected void configure() {
    final Catalog catalog = Mockito.mock(Catalog.class);
    final CatalogService catalogService = Mockito.mock(CatalogService.class);
    try {
        Mockito.when(catalogService.getCurrentCatalog(Mockito.any(Boolean.class), Mockito.any(Boolean.class), Mockito.any(InternalCallContext.class))).thenReturn(new MockCatalog());
        Mockito.when(catalogService.getFullCatalog(Mockito.any(Boolean.class), Mockito.any(Boolean.class), Mockito.any(InternalCallContext.class))).thenReturn(catalog);
        bind(CatalogService.class).toInstance(catalogService);
    } catch (CatalogApiException e) {
        throw new RuntimeException(e);
    }
}
Also used : CatalogApiException(org.killbill.billing.catalog.api.CatalogApiException) CatalogService(org.killbill.billing.catalog.api.CatalogService) InternalCallContext(org.killbill.billing.callcontext.InternalCallContext) Catalog(org.killbill.billing.catalog.api.Catalog)

Aggregations

CatalogService (org.killbill.billing.catalog.api.CatalogService)2 InternalCallContext (org.killbill.billing.callcontext.InternalCallContext)1 MockCatalog (org.killbill.billing.catalog.MockCatalog)1 MockCatalogService (org.killbill.billing.catalog.MockCatalogService)1 Catalog (org.killbill.billing.catalog.api.Catalog)1 CatalogApiException (org.killbill.billing.catalog.api.CatalogApiException)1 SubscriptionBaseApiService (org.killbill.billing.subscription.api.SubscriptionBaseApiService)1 SubscriptionBaseTimelineApi (org.killbill.billing.subscription.api.timeline.SubscriptionBaseTimelineApi)1 SubscriptionDao (org.killbill.billing.subscription.engine.dao.SubscriptionDao)1 NonEntityDao (org.killbill.billing.util.dao.NonEntityDao)1 BeforeMethod (org.testng.annotations.BeforeMethod)1