Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mockito-logger to be configurable as Mockito extension #1430

Merged
merged 1 commit into from Jan 31, 2019

Conversation

bedla
Copy link
Contributor

@bedla bedla commented Jul 15, 2018

Hi,
we have many of legacy tests that do over-mocking code base - lots of unused mocking there (we are cleaning it slowly). We have user @MockitoSettings(strictness = Strictness.WARN) switch to log and not fail in this situactions. By default all logs are printed out to console using System.out.println and this make us trouble because we have "silent" profile at CI server which is configured to silent Loggers / as you expect sith .println we are not trully silent in this case :]
Thats why I have created this PR proposal and want to know what do you think.
Thx,
Ivos

@bedla bedla force-pushed the logger-extension branch 2 times, most recently from ab12d97 to 0ede2b0 Compare July 15, 2018 13:02
@codecov-io
Copy link

codecov-io commented Jul 15, 2018

Codecov Report

Merging #1430 into release/2.x will increase coverage by <.01%.
The diff coverage is 90%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/2.x    #1430      +/-   ##
=================================================
+ Coverage          87.53%   87.54%   +<.01%     
- Complexity          2435     2437       +2     
=================================================
  Files                300      300              
  Lines               6250     6255       +5     
  Branches             775      775              
=================================================
+ Hits                5471     5476       +5     
  Misses               582      582              
  Partials             197      197
Impacted Files Coverage Δ Complexity Δ
.../mockito/internal/junit/StubbingArgMismatches.java 100% <ø> (ø) 9 <0> (ø) ⬇️
.../internal/session/MockitoSessionLoggerAdapter.java 100% <ø> (ø) 2 <0> (ø) ⬇️
.../mockito/internal/junit/UniversalTestListener.java 93.54% <ø> (ø) 13 <0> (ø) ⬇️
...mockito/internal/session/MockitoLoggerAdapter.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...rg/mockito/internal/util/ConsoleMockitoLogger.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...va/org/mockito/internal/junit/UnusedStubbings.java 76% <ø> (ø) 8 <0> (ø) ⬇️
...kito/internal/framework/DefaultMockitoSession.java 96.15% <ø> (ø) 6 <0> (ø) ⬇️
...ain/java/org/mockito/internal/junit/JUnitRule.java 96% <ø> (ø) 4 <0> (ø) ⬇️
.../internal/junit/MismatchReportingTestListener.java 100% <ø> (ø) 4 <0> (ø) ⬇️
...ito/runners/ConsoleSpammingMockitoJUnitRunner.java 29.41% <0%> (ø) 2 <0> (ø) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dad3ef7...ee37eed. Read the comment docs.

@mgajdos
Copy link

mgajdos commented Jul 15, 2018

+1

@bedla bedla changed the title Allow mockito-logger configurable as Mockito extension Allow mockito-logger to be configurable as Mockito extension Aug 1, 2018
@bedla
Copy link
Contributor Author

bedla commented Nov 20, 2018

rebased with current upstream

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, I had missed it. Sorry for the long wait :(

Just 1 more comment regarding the documentation. We also need another rebase, as I just fixed an issue with Java 11 javadoc generation. After that we are good to go. Thanks again!

@@ -2,7 +2,7 @@
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util;
package org.mockito.plugins;

public interface MockitoLogger {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to need some additional documentation here. https://static.javadoc.io/org.mockito/mockito-core/2.23.4/org/mockito/plugins/MockMaker.html is probably a good starting point of what we can add as documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, i hope that description is sufficient :]

Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TimvdLippe TimvdLippe merged commit 074c06d into mockito:release/2.x Jan 31, 2019
@bedla
Copy link
Contributor Author

bedla commented Jan 31, 2019

thx a lot ;]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants