08-02-2023, 06:29 AM
I want to throw an Exception when running a void method
when(booking.validate(any())).thenThrow(BookingException.builder().build());
but I have a compilation error:
Required type: T
Provided: void
reason: no instance(s) of type variable(s) T exist so that void conforms to T
when(booking.validate(any())).thenThrow(BookingException.builder().build());
but I have a compilation error:
Required type: T
Provided: void
reason: no instance(s) of type variable(s) T exist so that void conforms to T