You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/10/03 18:39:58 UTC

[maven-site] branch master updated: [ARCHETYPE-594] recommend Mockito

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4b36ed1  [ARCHETYPE-594] recommend Mockito
4b36ed1 is described below

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

    [ARCHETYPE-594] recommend Mockito
    
    Closes #158
---
 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..344ba55 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 codebase 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 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.