@PrepareForTest(value={ServiceRunner.class,com.lambdaworks.redis.RedisConnection.class,LocalOrchestrator.class,LogUtils.class})
@PowerMockIgnore(value={"javax.crypto.*","javax.management.*"})
public class AdCacheSpec_reserveMoney
extends Object
| Modifier and Type | Class and Description |
|---|---|
private class |
AdCacheSpec_reserveMoney.CalcControlValues |
private class |
AdCacheSpec_reserveMoney.ControlValues |
| Modifier and Type | Field and Description |
|---|---|
private long |
bidPrice |
private long |
bids |
private long |
budget |
private AdCacheConfig |
config |
private Lot49Config |
configMock |
private String |
endsOnStr |
private long |
prevProjectedSpend |
private long |
prevSpendAmount |
private ServiceRunner |
serviceRunnerSimpleMock |
private long |
spendAmount |
private String |
startsOnStr |
private int |
ttlMinutes |
private long |
wins |
| Constructor and Description |
|---|
AdCacheSpec_reserveMoney() |
private ServiceRunner serviceRunnerSimpleMock
private Lot49Config configMock
private AdCacheConfig config
private long bidPrice
private long wins
private long bids
private long budget
private long spendAmount
private long prevProjectedSpend
private long prevSpendAmount
private int ttlMinutes
private String startsOnStr
private String endsOnStr
public void negativeFlow_notABidder()
throws Lot49Exception
Lot49Exceptionpublic void negativeFlow_noMoneyLeft()
throws Lot49Exception
Lot49Exceptionpublic void positiveFlow_prevAdIsNull()
throws Exception
Exceptionpublic void positiveFlow_prevAdNotNull()
throws Exception
Exceptionprivate AdCache createAdCache() throws Lot49Exception
Lot49Exceptionprivate RedisDaoCounters createRedisDaoCountersMock(Ad ad, long wins, long bids, long spendAmount, long bidAmount) throws Lot49Exception
Lot49Exceptionprivate com.lambdaworks.redis.RedisConnection<String,String> createRedisConnectionMock(Ad ad, long budget, String startsOnStr, String endsOnStr, long bidPrice)
public void positiveFlow_prevAdIsNullAndNotFirstRun()
throws Exception
Exceptionpublic void negativeFlow_startsOnIsAfterNow()
throws Exception
Exceptionpublic void negativeFlow_startsOnIsInvalid()
throws Exception
Exceptionpublic void negativeFlow_endsOnIsBeforeNow()
throws Exception
Exceptionpublic void positiveFlow_endsOnIsASAP()
throws Exception
Exceptionpublic void positiveFlow_endsOnIsValid()
throws Exception
Exceptionpublic void positiveFlow_endsOnIsNull()
throws Exception
Exceptionpublic void positiveFlow_endsOnIsInvalid()
throws Exception
Exceptionpublic void positiveFlow_bidPriceIsNull()
throws Exception
Exceptionpublic void positiveFlow_bidPriceIsInvalid()
throws Exception
Exceptionpublic void negativeFlow_budgetIsNegative()
throws Exception
Exceptionpublic void positiveFlow_budgetIsUnlimited()
throws Exception
Exceptionprivate String testReserveMoney_prevAdIsNull(boolean positeveFlow, AdCacheSpec_reserveMoney.ControlValues cv) throws Exception
Exceptionprivate void commonAssertions(String msg, AdCacheSpec_reserveMoney.ControlValues cv)
public void positiveFlow_prevAdSpendAmountIsPositiveAndLessThanBudget()
throws Exception
Exceptionpublic void positiveFlow_prevAdSpendAmountIsPositiveAndGreaterThanBudget()
throws Exception
Exceptionprivate void testReserveMoney_prevAdIsNotNull(boolean positeveFlow,
AdCacheSpec_reserveMoney.ControlValues cv)
throws Lot49Exception,
Exception
Lot49ExceptionExceptionprivate BidderCalendar getBidderCalendar()