在Java语言中使用Mockito?

huangapple go评论77阅读模式
英文:

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/

huangapple
  • 本文由 发表于 2020年5月5日 12:34:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/61605848.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定