@Inject public DefaultCatalogCache(final OSGIServiceRegistration<CatalogPluginApi> pluginRegistry, final VersionedCatalogMapper versionedCatalogMapper, final CacheControllerDispatcher cacheControllerDispatcher, final VersionedCatalogLoader loader, final PriceOverride priceOverride, final InternalCallContextFactory internalCallContextFactory) { this.pluginRegistry = pluginRegistry; this.versionedCatalogMapper = versionedCatalogMapper; this.cacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_CATALOG); this.loader = loader; this.priceOverride = priceOverride; this.internalCallContextFactory = internalCallContextFactory; this.cacheLoaderArgumentWithTemplateFiltering = initializeCacheLoaderArgument(true); this.cacheLoaderArgument = initializeCacheLoaderArgument(false); setDefaultCatalog(); }
@BeforeMethod(groups = "fast") protected void beforeMethod() throws Exception { if (hasFailed()) { return; } cacheControllerDispatcher.clearAll(); multiTenantContext = Mockito.mock(InternalTenantContext.class); Mockito.when(multiTenantContext.getAccountRecordId()).thenReturn(456L); Mockito.when(multiTenantContext.getTenantRecordId()).thenReturn(99L); otherMultiTenantContext = Mockito.mock(InternalCallContext.class); Mockito.when(otherMultiTenantContext.getAccountRecordId()).thenReturn(123L); Mockito.when(otherMultiTenantContext.getTenantRecordId()).thenReturn(112233L); ((DefaultCatalogCache) catalogCache).setDefaultCatalog(); }
final DefaultVersionedCatalog pluginVersionedCatalog = getCatalogFromPlugins(tenantContext); if (pluginVersionedCatalog != null) { return pluginVersionedCatalog; initializeCatalog(tenantCatalog);
final DefaultVersionedCatalog tenantCatalog = cacheController.get(internalTenantContext.getTenantRecordId(), cacheLoaderArgument); if (tenantCatalog != null) { initializeCatalog(tenantCatalog); if (tenantCatalog.getEffectiveDate().compareTo(latestCatalogUpdatedDate.toDate()) == 0) {
@BeforeMethod(groups = "fast") protected void beforeMethod() throws Exception { if (hasFailed()) { return; } cacheControllerDispatcher.clearAll(); multiTenantContext = Mockito.mock(InternalTenantContext.class); Mockito.when(multiTenantContext.getAccountRecordId()).thenReturn(456L); Mockito.when(multiTenantContext.getTenantRecordId()).thenReturn(99L); otherMultiTenantContext = Mockito.mock(InternalCallContext.class); Mockito.when(otherMultiTenantContext.getAccountRecordId()).thenReturn(123L); Mockito.when(otherMultiTenantContext.getTenantRecordId()).thenReturn(112233L); ((DefaultCatalogCache) catalogCache).setDefaultCatalog(); }
final DefaultVersionedCatalog pluginVersionedCatalog = getCatalogFromPlugins(tenantContext); if (pluginVersionedCatalog != null) { return pluginVersionedCatalog; initializeCatalog(tenantCatalog);
final DefaultVersionedCatalog tenantCatalog = cacheController.get(internalTenantContext.getTenantRecordId(), cacheLoaderArgument); if (tenantCatalog != null) { initializeCatalog(tenantCatalog); if (tenantCatalog.getEffectiveDate().compareTo(latestCatalogUpdatedDate.toDate()) == 0) {
@Inject public DefaultCatalogCache(final OSGIServiceRegistration<CatalogPluginApi> pluginRegistry, final VersionedCatalogMapper versionedCatalogMapper, final CacheControllerDispatcher cacheControllerDispatcher, final VersionedCatalogLoader loader, final PriceOverride priceOverride, final InternalCallContextFactory internalCallContextFactory) { this.pluginRegistry = pluginRegistry; this.versionedCatalogMapper = versionedCatalogMapper; this.cacheController = cacheControllerDispatcher.getCacheController(CacheType.TENANT_CATALOG); this.loader = loader; this.priceOverride = priceOverride; this.internalCallContextFactory = internalCallContextFactory; this.cacheLoaderArgumentWithTemplateFiltering = initializeCacheLoaderArgument(true); this.cacheLoaderArgument = initializeCacheLoaderArgument(false); setDefaultCatalog(); }