Metode yang mengembalikan aliran argumen junit
// A method that returns a stream of JUnit Arguments
private static Stream<Arguments> dataForTestSearchString() {
return Stream.of(//
Arguments.of("Any string matches any string.", "(.*)", "xyz", "xyz") //
, Arguments.of("Pick year digits out of a date.", "[0-9]{2}/[0-9]{2}/([0-9]{4})", "31/12/2032", "2032") //
, Arguments.of("No digits found.", "[0-9]+", "not a digit", null) //
, Arguments.of("First two words.", "(?<firstTwoWords>\\w+ \\w+) .*", "abc xyz one two", "abc xyz") //
, Arguments.of("Bad regex.", "([0-9+)", "123", "PatternSyntaxException: (?s)Unclosed character class.*") //
);
}
Kalande77 Kapaya