给定以下枚举:
public enum SupportedLoanProcessor {
PRE_AUTHORIZED,
ACCURED_INTEREST
}
如果类型为 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")
}
如何测试默认情况。我正在使用groovy和junit。我想在运行时修改枚举是可能的。但我不知道怎么做。