79774433

Date: 2025-09-25 06:35:23
Score: 1.5
Natty:
Report link

In addition to the @rzwitserloot reply:

If you want to test this, you can create a parameterized test that uses all possible values of your enum. If a new, not supported value is added, a MatchException will be thrown.

@ParameterizedTest
@EnumSource(DeviceType.class)
void verifyThatAllDeviceTypeValuesAreSupportedByExecute(DeviceType deviceType) {   
  assertDoesNotThrow(() -> testee.execute(deviceType)); 
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @rzwitserloot
  • Low reputation (1):
Posted by: Thorsten Klaus