cookbook:ut
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 后一修订版 | 前一修订版 | ||
| cookbook:ut [2021/10/13 15:06] – 创建 plough | cookbook:ut [2022/01/10 13:09] (当前版本) – plough | ||
|---|---|---|---|
| 行 8: | 行 8: | ||
| }); | }); | ||
| assertEquals(exception.getStatus(), | assertEquals(exception.getStatus(), | ||
| + | </ | ||
| + | |||
| + | ===== 捕获参数 ===== | ||
| + | < | ||
| + | var captor = ArgumentCaptor.forClass(GetFileRequest.class); | ||
| + | when(jetfirePublicApi.downloadFile(captor.capture())).thenReturn(file); | ||
| + | File resFile = client.downloadFile(fileId); | ||
| + | assertEquals(captor.getValue().getId(), | ||
| + | </ | ||
| + | |||
| + | ===== Spring UT ===== | ||
| + | < | ||
| + | @SpringBootTest | ||
| + | @TestPropertySource(locations = " | ||
| + | public class ColumnStrategyManagerTest extends AbstractTestNGSpringContextTests { | ||
| + | @Autowired ApplicationContext ctx; | ||
| + | ... | ||
| </ | </ | ||
cookbook/ut.1634108798.txt.gz · 最后更改: 2021/10/13 15:06 由 plough