Complete the code to use @EnumSource to run the test for all enum values.
@ParameterizedTest @EnumSource([1].class) void testEnumValues([1] value) { assertNotNull(value); }
Complete the code to run the test only for the enum values MONDAY and FRIDAY.
@ParameterizedTest @EnumSource(value = Day.class, names = {"[1]", "FRIDAY"}) void testSelectedDays(Day day) { assertTrue(day == Day.MONDAY || day == Day.FRIDAY); }
Fix the error in the code to exclude the enum value SUNDAY from the test.
@ParameterizedTest @EnumSource(value = Day.class, mode = EnumSource.Mode.EXCLUDE, names = {"[1]"}) void testExcludeSunday(Day day) { assertNotEquals(Day.SUNDAY, day); }
Fill both blanks to run the test only for enum values starting with 'TUES'.
@ParameterizedTest @EnumSource(value = Day.class, names = {"[1]"}, mode = EnumSource.Mode.INCLUDE) void testDaysStartingWithTues(Day day) { assertTrue(day.name().startsWith("[2]")); }
Fill all three blanks to run the test for enum values MONDAY and FRIDAY and assert their ordinal values.
@ParameterizedTest @EnumSource(value = Day.class, names = {"[1]", "[2]"}) void testDayOrdinals(Day day) { int ordinal = day.ordinal(); assertTrue(ordinal == [3] || ordinal == 5); }
