Skip to content

Commit

Permalink
fixed junit test
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Dec 2, 2020
1 parent af03557 commit 9ef5b30
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ public void test1stDayInMonth() throws PluginException {
LocalDateTime date = intervalPlugin.evalCron(cron);
logger.info("Result monthyl=" + date);
LocalDateTime now = LocalDateTime.now();
Assert.assertEquals(date.getMonthValue(), now.getMonthValue() + 1);
int exptectedMonth= now.getMonthValue() +1;
if (exptectedMonth==13) {
// year switch
exptectedMonth=1;
}
Assert.assertEquals(date.getMonthValue(),exptectedMonth);
}

/**
Expand Down Expand Up @@ -135,7 +140,12 @@ public void testMonthly() throws PluginException {
logger.info("Now =" + now);
logger.info("Result @monthly=" + date);
Assert.assertEquals(now.getDayOfMonth(), date.getDayOfMonth());
Assert.assertEquals(now.getMonthValue() + 1, date.getMonthValue());
int exptectedMonth= now.getMonthValue() +1;
if (exptectedMonth==13) {
// year switch
exptectedMonth=1;
}
Assert.assertEquals(exptectedMonth, date.getMonthValue());
}

/**
Expand Down

0 comments on commit 9ef5b30

Please sign in to comment.