Given the following enum:
public enum SupportedLoanProcessor {
PRE_AUTHORIZED,
ACCURED_INTEREST
}
And a switch working on a value if the type SupportedLoanProessor
switch(processorType){
case SupportedLoanProcessor.PRE_AUTHORIZED:
result = processPreAuthorized allLendingsWithALoan, date
break
case SupportedLoanProcessor.ACCURED_INTEREST:
result = processAccuredInterest allLendingsWithALoan, date
break
default:
throw new IllegalArgumentException("Unknow loan processor: $processorType")
}
How could a do to test the default case. I'm using groovy and junit. I suppose modifying the enum at runtime could be possible. But i don't know how.