问题描述
当我使用@WebMvcTest(Controller.class)
public class ControllerTest {
@MockBean
private ProcessorFactory processorFactory ;
@MockBean
private IProcessor processor;
@Autowired
private MockMvc mockMvc;
@Test
public void test1() throws Exception {
when(processor.process(any(Request.class),any(String.class)))
.thenReturn(new BlaBla("Test","Test"));
String request = ...
this.mockMvc.perform(post("/test/test").contentType(MediaType.APPLICATION_JSON).content(request))
.andDo(print())
.andExpect(status().is2xxSuccessful());
}
}
这样的说法时,它工作正常。但是现在我喜欢使用默认模板值,因此我将其更改为Event<void()>
,以便可以使用template<class _Fty = void()>
。但是它似乎因一系列错误而失败。
Event<> aEvent
任何人都可以建议如何完成如上所述的工作吗?
template<class _Fty>
struct Event final {
typedef std::function<_Fty> listener_type;
...
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)