TeslaCN opened a new issue, #19708:
URL: https://github.com/apache/shardingsphere/issues/19708

   ## Code of Conduct
   
   According to Mockito's code, Silent is not recommended to use in tests.
   
   ```java
       /**
        * This Mockito JUnit Runner implementation *ignores*
        * stubbing argument mismatches ({@link MockitoJUnitRunner.StrictStubs})
        * and *does not detect* unused stubbings.
        * The runner remains 'silent' even if incorrect stubbing is present.
        * It is an equivalent of {@link Strictness#LENIENT}.
        * This was the behavior of Mockito JUnit runner in versions 1.x.
        * Using this implementation of the runner is not recommended.
        * Engineers should care for removing unused stubbings because they are 
dead code,
        * they add unnecessary details, potentially making the test code harder 
to comprehend.
        * If you have good reasons to use the silent runner, let us know at the 
mailing list
        * or raise an issue in our issue tracker.
        * The purpose of silent implementation is to satisfy edge/unanticipated 
use cases,
        * and to offer users an opt-out.
        * Mockito framework is opinionated to drive clean tests but it is not 
dogmatic.
        * <p>
        * See also {@link UnnecessaryStubbingException}.
        * <p>
        * Usage:
        * <pre class="code"><code class="java">
        * <b>&#064;RunWith(MockitoJUnitRunner.Silent.class)</b>
        * public class ExampleTest {
        *   // ...
        * }
        * </code></pre>
        *
        * @since 2.1.0
        */
       public static class Silent extends MockitoJUnitRunner {
           public Silent(Class<?> klass) throws InvocationTargetException {
               super(new RunnerFactory().create(klass));
           }
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to