在Spring 1.5.0中-使用扩展AbstractMvcEndpoint创建的执行器
MockMvc mockMvc = standaloneSetup(controller).build()
工作正常。
我使用spring 2注释创建了一个自定义的执行器端点。(@ RestControllerEndpoint)。它的工作正常。 在使用简单的模拟编写单元测试时。
EncryptionService encryptionService = new EncryptionService(smsSecretKey : "Tdjn/Exd1bs/qMJwZJ4Ey0ErYJd4tpMtQefYKh5hlJo=")
EventProcessingClientV2 eventProcessing = EasyMock.createStrictMock(EventProcessingClientV2)
NexmoEventTranslator eventTranslator = new NexmoEventTranslator(eventProcessing : eventProcessing, encryptionService : encryptionService)
EventProcessingHealthEndpoint controller = new EventProcessingHealthEndpoint(eventTranslator : eventTranslator)
@Autowired
WebApplicationContext context;
MockMvc mockMvc;
void setup(){
mockMvc = MockMvcBuilders.webAppContextSetup(this.context).build()
}
无法模拟EventProcessingClientV2吗?