Added tests
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package com.plannaplan.entities;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.sql.Date;
|
||||
@ -141,22 +140,50 @@ public class AppConfigTest {
|
||||
|
||||
@Test
|
||||
public void shouldReturnFirstStartDatesCorns() {
|
||||
assertFalse(false);
|
||||
final Date firtstTourStart = Date.valueOf("2020-11-12");
|
||||
final Date firtstTourEnd = Date.valueOf("2020-11-13");
|
||||
final Date secondTourStart = Date.valueOf("2020-11-14");
|
||||
final Date secondTourEnd = Date.valueOf("2020-11-15");
|
||||
|
||||
final AppConfig config = new AppConfig(new TourData(firtstTourStart, firtstTourEnd),
|
||||
new TourData(secondTourStart, secondTourEnd));
|
||||
assertTrue(config.getFirstTourStartCron().getExpression().equals("0 0 0 12 11 ?"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnSecondStartDatesCorns() {
|
||||
assertFalse(false);
|
||||
final Date firtstTourStart = Date.valueOf("2020-11-12");
|
||||
final Date firtstTourEnd = Date.valueOf("2020-11-13");
|
||||
final Date secondTourStart = Date.valueOf("2020-11-14");
|
||||
final Date secondTourEnd = Date.valueOf("2020-11-15");
|
||||
|
||||
final AppConfig config = new AppConfig(new TourData(firtstTourStart, firtstTourEnd),
|
||||
new TourData(secondTourStart, secondTourEnd));
|
||||
assertTrue(config.getSecondTourStartCron().getExpression().equals("0 0 0 14 11 ?"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnFirstEndDatesCorns() {
|
||||
assertFalse(false);
|
||||
final Date firtstTourStart = Date.valueOf("2020-11-12");
|
||||
final Date firtstTourEnd = Date.valueOf("2020-11-13");
|
||||
final Date secondTourStart = Date.valueOf("2020-11-14");
|
||||
final Date secondTourEnd = Date.valueOf("2020-11-15");
|
||||
|
||||
final AppConfig config = new AppConfig(new TourData(firtstTourStart, firtstTourEnd),
|
||||
new TourData(secondTourStart, secondTourEnd));
|
||||
assertTrue(config.getFirstTourEndCron().getExpression().equals("0 0 0 13 11 ?"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldReturnSecondEndDatesCorns() {
|
||||
assertFalse(false);
|
||||
final Date firtstTourStart = Date.valueOf("2020-11-12");
|
||||
final Date firtstTourEnd = Date.valueOf("2020-11-13");
|
||||
final Date secondTourStart = Date.valueOf("2020-11-14");
|
||||
final Date secondTourEnd = Date.valueOf("2020-11-15");
|
||||
|
||||
final AppConfig config = new AppConfig(new TourData(firtstTourStart, firtstTourEnd),
|
||||
new TourData(secondTourStart, secondTourEnd));
|
||||
assertTrue(config.getSecondTourEndCron().getExpression().equals("0 0 0 15 11 ?"));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user