You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2020/04/18 12:36:05 UTC

[maven-site] 01/01: [ARCHETYPE-594] recommend Mockito

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch elharo-patch-3
in repository https://gitbox.apache.org/repos/asf/maven-site.git

commit 93587d4941426c93047047ccdf01bba9a024eab9
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Sat Apr 18 08:35:59 2020 -0400

    [ARCHETYPE-594] recommend Mockito
    
    @rfscholte
---
 content/apt/guides/development/guide-maven-development.apt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/content/apt/guides/development/guide-maven-development.apt b/content/apt/guides/development/guide-maven-development.apt
index 654a02a..f2311c2 100644
--- a/content/apt/guides/development/guide-maven-development.apt
+++ b/content/apt/guides/development/guide-maven-development.apt
@@ -56,6 +56,15 @@ Developing Maven
 
   You will find many unit tests. If at all possible, create or modify a unit test to demonstrate
   the problem, and then validate your fix.
+  
+  If you need to mock a class to write a test, use the Mockito framework.
+  Parts of the Maven codebse predate Mockito so you will encounter existing tests
+  that use EasyMock, PowerMock, and JMock. However, all newly written mocks
+  should use Mockito, even if this means a module or even a single class
+  uses multiple mocking frameworks. If an existing test class has complicated
+  legacy mock setup, you can add new Mockito based tests in a new test class.
+  There is no requirement that all tests for a single model class must be in
+  the same test class. It is OK to have multiple test classes per model class.
 
   If the problem case can't be set up in the unit tests, add an integration test. Before submitting a patch, in any
   case, you should run all of the integration tests. The tests require an empty local repository.