55import com .cronutils .model .definition .CronDefinitionBuilder ;
66import com .cronutils .model .time .ExecutionTime ;
77import com .cronutils .parser .CronParser ;
8+ import org .hamcrest .core .StringEndsWith ;
89import org .junit .Test ;
910
1011import java .time .LocalDate ;
1314import java .time .ZonedDateTime ;
1415import java .util .Optional ;
1516
16- import static org .junit . Assert . assertEquals ;
17- import static org .junit .Assert .fail ;
17+ import static org .hamcrest . core . StringEndsWith . endsWith ;
18+ import static org .junit .Assert .* ;
1819
1920public class Issue418Test {
2021
@@ -59,7 +60,7 @@ public void testInvalidWeekDayStart() {
5960 parser .parse ("0 0 2 ? * 0/7 *" );
6061 fail ("Expected exception for invalid expression" );
6162 } catch (IllegalArgumentException expected ) {
62- assertEquals ( "Failed to parse '0 0 2 ? * 0/7 *'. Value 0 not in range [1, 7]", expected . getMessage ( ));
63+ assertThat ( expected . getMessage (), endsWith ( " Value 0 not in range [1, 7]" ));
6364 }
6465 }
6566
@@ -71,7 +72,7 @@ public void testInvalidWeekDayEnd() {
7172 parser .parse ("0 0 2 ? * 1/8 *" );
7273 fail ("Expected exception for invalid expression" );
7374 } catch (IllegalArgumentException expected ) {
74- assertEquals ( "Failed to parse '0 0 2 ? * 1/8 *'. Period 8 not in range [1, 7]", expected . getMessage ( ));
75+ assertThat ( expected . getMessage (), endsWith ( " Period 8 not in range [1, 7]" ));
7576 }
7677 }
7778}
0 commit comments