Skip to content

Commit

Permalink
beatrix: Minor tweaks in testOverdueStateWith_WRITTEN_OFF. See #476
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrossie committed Jan 28, 2016
1 parent 59bb052 commit 7e27fe3
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -64,7 +64,7 @@ public String getOverdueConfig() {
}

@Test(groups = "slow")
public void testOverdueStateAndWRITTEN_OFFTag() throws Exception {
public void testOverdueStateWith_WRITTEN_OFF() throws Exception {
clock.setTime(new DateTime(2012, 5, 1, 0, 3, 42, 0));

// Set next invoice to fail and create subscription
Expand All @@ -84,25 +84,26 @@ public void testOverdueStateAndWRITTEN_OFFTag() throws Exception {
final Invoice nonNullInvoice = invoices.get(1);
assertTrue(nonNullInvoice.getBalance().compareTo(BigDecimal.ZERO) > 0);

// Set the WRITTEN_OFF tag (we set the clear state, hence the blocking event)
// Set the WRITTEN_OFF tag
busHandler.pushExpectedEvents(NextEvent.TAG);
tagUserApi.addTag(nonNullInvoice.getId(), ObjectType.INVOICE, ControlTagType.WRITTEN_OFF.getId(), callContext);
assertListenerStatus();

// Move after what should be OD1 (if invoice had not been written off)
addDaysAndCheckForCompletion(6);

// Should still be in clear state
// Should still be in clear state because of WRITTEN_OFF tag
checkODState(OverdueWrapper.CLEAR_STATE_NAME);

// Remove the WRITTEN_OFF tag and verify overdue state is now OD1
busHandler.pushExpectedEvents(NextEvent.TAG, NextEvent.BLOCK);
tagUserApi.removeTag(nonNullInvoice.getId(), ObjectType.INVOICE, ControlTagType.WRITTEN_OFF.getId(), callContext);
assertListenerStatus();
checkODState("OD1");
}

@Test(groups = "slow")
public void testNonOverdueAccountWithOverdueEnforcementOffTag() throws Exception {
public void testNonOverdueAccountWith_OVERDUE_ENFORCEMENT_OFF() throws Exception {

clock.setTime(new DateTime(2012, 5, 1, 0, 3, 42, 0));

Expand Down

0 comments on commit 7e27fe3

Please sign in to comment.