@PrepareForTest(value={com.lambdaworks.redis.RedisConnection.class,ServiceRunner.class,LogUtils.class})
@PowerMockIgnore(value={"javax.crypto.*","javax.management.*"})
public class AdCacheSpec_Refresh
extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
AdCacheSpec_Refresh.AdData |
| Modifier and Type | Field and Description |
|---|---|
(package private) String |
AD_CONFIG_SCRIPT_PACKAGE |
(package private) String |
AD_CONFIG_SCRIPT_SUBDIR |
private AdCacheConfig |
config |
private Lot49Config |
configMock |
org.junit.rules.TemporaryFolder |
folder |
private ServiceRunner |
serviceRunnerSimpleMock |
private int |
ttlMinutes |
private String |
wroteFile |
| Constructor and Description |
|---|
AdCacheSpec_Refresh() |
private AdCacheConfig config
private ServiceRunner serviceRunnerSimpleMock
private Lot49Config configMock
public org.junit.rules.TemporaryFolder folder
String AD_CONFIG_SCRIPT_PACKAGE
String AD_CONFIG_SCRIPT_SUBDIR
private int ttlMinutes
private String wroteFile
public void setConfig(AdCacheConfig config)
public void setServiceRunnerSimpleMock(ServiceRunner serviceRunnerSimpleMock)
public void setConfigMock(Lot49Config configMock)
public void negativeFlow_noBidPriceCalculatorsInDir()
throws Lot49Exception,
IOException
Lot49ExceptionIOExceptionpublic void negativeFlow_noAdsInAdDir()
throws Lot49Exception,
IOException
Lot49ExceptionIOExceptionpublic void negativeFlow_adFileNameNeedsNumber()
throws Lot49Exception,
IOException
Lot49ExceptionIOExceptionpublic void negativeFlow_adFileNameIsEmpty()
throws Lot49Exception,
IOException
Lot49ExceptionIOExceptionpublic void negativeFlow_cannotAllocateMoney()
throws Exception
Exceptionpublic void positiveFlow_2consecutiveRuns()
throws Exception
Exceptionpublic AdCache createAdCache() throws Lot49Exception, IOException
Lot49ExceptionIOExceptionprivate ClientConfig createClientConfig(String packageName)
private RedisDaoCounters createRedisDaoCountersMock(List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception
Lot49Exceptionprivate com.lambdaworks.redis.RedisConnection<String,String> createRedisConnectionMock(List<AdCacheSpec_Refresh.AdData> ads)
public void negativeFlow_redisConnectionIsNull()
throws Lot49Exception
Lot49Exceptionpublic void negativeFlow_wroteFileDoesNotExist()
throws Exception
Exceptionpublic void positiveFlow_severalAdFiles()
throws Exception
Exceptionpublic void negativeFlow_badClientConfig()
throws Exception
Exceptionpublic void positiveFlow_clientAdFiles()
throws Exception
Exceptionpublic void negativeFlow_bidProbabilityIsZero()
throws Exception
Exceptionpublic void positiveFlow_redisConZError()
throws Exception
Exceptionpublic void positiveFlow_twoConsecutiveRefresh()
throws Exception
Exceptionpublic void positiveFlow_twoConsecutiveRefreshWithOptouts()
throws Exception
Exceptionpublic void positiveFlow_twoConsecutiveRefreshWithCancelStoreAdState()
throws Exception
Exceptionpublic void positiveFlow_twoConsecutiveRefreshWithDifferentAds()
throws Exception
Exceptionprivate String testRefresh(AdCacheSpec_Refresh.AdData ad) throws Lot49Exception, IOException
Lot49ExceptionIOExceptionpublic String testRefresh(AdCache adCache, AdCacheSpec_Refresh.AdData ad) throws Lot49Exception, IOException
Lot49ExceptionIOExceptionprivate String testRefresh(List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception, IOException
Lot49ExceptionIOExceptionprivate String testRefresh(AdCache adCache, List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception, IOException
Lot49ExceptionIOExceptionpublic void commonAssertions(String resultMessage, int adsNoUserNeeded, int adsUserNeeded)