????????Mock??Stub??????
???????????? ???????[ 2013/10/18 10:13:27 ] ????????
?????????????Mock Object ????????????????????????Mock???????????У???????????blogService.save(blog) ???????blogDao??save(blog) ???????????????????????????????? blog???????????????blogDao??????????????????????????
?????????????????????????Dummy Objec?? Mock Object??????????TestDouble ??????????????????????????????????????к????л???????????????????????????????С????仰???????????????????????????Stub??????????Mock?????Stub??Mock????Stub ?????????????С??????????????????????????
?????????Щ????????Mock??????????????????????????????з??????????blogDAO.save(blog)????????????????????д??????????????????????????????????????д?BlogService??????????в???????????????????????blogDAO.save(blog) ??з??????????????????????????????????????????????????TestSpy????????????????????????Dynamic Mock framework ??????????????????TestSpy???????????дTestSpy??????????д?????????Mock??????????????????????????????????“????DAO????????????”?? ???????????????blogDao??save(blog) ???????????????save(blog)??????????????????????save(blog)???????????????????“????DAO????????????”???????????????????????Mock ??????perfectl valid?????С????????????У????????setTitle("title")?? setContent("content")??setCreatedTime(new Date())????Щ???????????????κι????
?????Щcomments??
????“??????????????????????????Service????????????Service????????????????DAO??????????????”
????--??????????????????? Service??з??????????????????DAO????з???????????в??????????????????????????????????????????????blogDao??save(blog)?? ?????á?
????“????Service???????????????????????“
????--????????????????г??????????????Service class ???????????but just some interaction with other classes. ???磬Service class ???????DTO?????? ?????Mapper ????Map ??Entity object????Validator ? validate?? ?? logger д ??? log?? ????DAO ?浽?????????????£????ò????Щ????Mock ??Interactive ?????
???????????
????·???????? Mock
????·????Mock????????Mock??????μ?
????·??????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11