I'm a technical lead on the Android project, enthusiast in learning technologies, free spirit writer. On my way I decided to choose Robolectric and answer my questions about the structure of a library ...
When we unit test Spring MVC applications, we test each layer separately from the others. We create mock implementations, typically using Mockito, for each layer’s dependencies, then we simulate the ...
Hamcrest is based on the concept of a matcher, which can be a very natural way of asserting whether or not the result of a test is in a desired state. If you have not used Hamcrest, examples in this ...
JUnit Pioneer provides extensions for the JUnit Framework and its Jupiter API. It does not limit itself to proven ideas with wide application but is purposely open to experimentation. It aims to spin ...
Unit tests are aimed at testing small isolated components of code that can be predictably executed any number of times to yield the same outcome. Mocks provide a convenient mechanism to circumvent ...
最近在做某个项目的时候一直使用 @MockBean 来解决单元测试中 Mock 类装配到被测试类的问题。这篇文章主要介绍了 @MockBean 的使用例子以及不使用 @MockBean 而使用@SpyBean 的情景和原因。 文章中的所有代码均为 Kotlin 语言,与 Java 略有不同。但是 Kotlin 的语法比较 ...