英文:
Mockito use in Java language?
问题
如何在入门级别使用Mockito?如果是的话,在哪里使用?它对编码是否重要,还是只与测试部分有关?
英文:
How is Mockito used by Java Developers at entry level ?If yes where
Is it important for coding or just related to testing part ?
答案1
得分: 3
Mockito仅用于测试,通常与JUnit一起使用,为依赖项提供模拟。这意味着您可以对类/方法进行单元测试,而无需依赖于其他依赖项,类或服务的实际实现,特别是如果它们尚未可用。
更多详细信息请参见:https://site.mockito.org/
英文:
Mockito is used only for testing, and it is usually used with JUnit to provide mocks for dependencies. This means you are able to unit test a class / method, without having to rely on the actual implementation of other dependencies, classes, or services, especially if they are not yet available.
More details here: https://site.mockito.org/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论