@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
Lot49Exception
public void negativeFlow_noMoneyLeft() throws Lot49Exception
Lot49Exception
public void positiveFlow_prevAdIsNull() throws Exception
Exception
public void positiveFlow_prevAdNotNull() throws Exception
Exception
private AdCache createAdCache() throws Lot49Exception
Lot49Exception
private RedisDaoCounters createRedisDaoCountersMock(Ad ad, long wins, long bids, long spendAmount, long bidAmount) throws Lot49Exception
Lot49Exception
private com.lambdaworks.redis.RedisConnection<String,String> createRedisConnectionMock(Ad ad, long budget, String startsOnStr, String endsOnStr, long bidPrice)
public void positiveFlow_prevAdIsNullAndNotFirstRun() throws Exception
Exception
public void negativeFlow_startsOnIsAfterNow() throws Exception
Exception
public void negativeFlow_startsOnIsInvalid() throws Exception
Exception
public void negativeFlow_endsOnIsBeforeNow() throws Exception
Exception
public void positiveFlow_endsOnIsASAP() throws Exception
Exception
public void positiveFlow_endsOnIsValid() throws Exception
Exception
public void positiveFlow_endsOnIsNull() throws Exception
Exception
public void positiveFlow_endsOnIsInvalid() throws Exception
Exception
public void positiveFlow_bidPriceIsNull() throws Exception
Exception
public void positiveFlow_bidPriceIsInvalid() throws Exception
Exception
public void negativeFlow_budgetIsNegative() throws Exception
Exception
public void positiveFlow_budgetIsUnlimited() throws Exception
Exception
private String testReserveMoney_prevAdIsNull(boolean positeveFlow, AdCacheSpec_reserveMoney.ControlValues cv) throws Exception
Exception
private void commonAssertions(String msg, AdCacheSpec_reserveMoney.ControlValues cv)
public void positiveFlow_prevAdSpendAmountIsPositiveAndLessThanBudget() throws Exception
Exception
public void positiveFlow_prevAdSpendAmountIsPositiveAndGreaterThanBudget() throws Exception
Exception
private void testReserveMoney_prevAdIsNotNull(boolean positeveFlow, AdCacheSpec_reserveMoney.ControlValues cv) throws Lot49Exception, Exception
Lot49Exception
Exception
private BidderCalendar getBidderCalendar()