@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
Lot49Exception
IOException
public void negativeFlow_noAdsInAdDir() throws Lot49Exception, IOException
Lot49Exception
IOException
public void negativeFlow_adFileNameNeedsNumber() throws Lot49Exception, IOException
Lot49Exception
IOException
public void negativeFlow_adFileNameIsEmpty() throws Lot49Exception, IOException
Lot49Exception
IOException
public void negativeFlow_cannotAllocateMoney() throws Exception
Exception
public void positiveFlow_2consecutiveRuns() throws Exception
Exception
public AdCache createAdCache() throws Lot49Exception, IOException
Lot49Exception
IOException
private ClientConfig createClientConfig(String packageName)
private RedisDaoCounters createRedisDaoCountersMock(List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception
Lot49Exception
private com.lambdaworks.redis.RedisConnection<String,String> createRedisConnectionMock(List<AdCacheSpec_Refresh.AdData> ads)
public void negativeFlow_redisConnectionIsNull() throws Lot49Exception
Lot49Exception
public void negativeFlow_wroteFileDoesNotExist() throws Exception
Exception
public void positiveFlow_severalAdFiles() throws Exception
Exception
public void negativeFlow_badClientConfig() throws Exception
Exception
public void positiveFlow_clientAdFiles() throws Exception
Exception
public void negativeFlow_bidProbabilityIsZero() throws Exception
Exception
public void positiveFlow_redisConZError() throws Exception
Exception
public void positiveFlow_twoConsecutiveRefresh() throws Exception
Exception
public void positiveFlow_twoConsecutiveRefreshWithOptouts() throws Exception
Exception
public void positiveFlow_twoConsecutiveRefreshWithCancelStoreAdState() throws Exception
Exception
public void positiveFlow_twoConsecutiveRefreshWithDifferentAds() throws Exception
Exception
private String testRefresh(AdCacheSpec_Refresh.AdData ad) throws Lot49Exception, IOException
Lot49Exception
IOException
public String testRefresh(AdCache adCache, AdCacheSpec_Refresh.AdData ad) throws Lot49Exception, IOException
Lot49Exception
IOException
private String testRefresh(List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception, IOException
Lot49Exception
IOException
private String testRefresh(AdCache adCache, List<AdCacheSpec_Refresh.AdData> ads) throws Lot49Exception, IOException
Lot49Exception
IOException
public void commonAssertions(String resultMessage, int adsNoUserNeeded, int adsUserNeeded)