摘要: 背景 单元测试中很多对象需要mock,每次都要写很多重复代码 解决 Mockito提供了@Mock注解,但需要其他操作配合注解 方案1 MockitoAnnotations @Before public void setUp() { MockitoAnnotations.initMocks(this 阅读全文
posted @ 2021-07-05 00:02 yupenglei 阅读(181) 评论(0) 推荐(0)
摘要: 描述 BDD given some preconditions (Arrange) when an action occurs (Act) then verify the output (Assert) 行为驱动开发 given(Arrange): 布置环境 when(Act): 表演 then(A 阅读全文
posted @ 2021-07-05 00:00 yupenglei 阅读(317) 评论(0) 推荐(0)