You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2023/01/03 16:56:20 UTC
[GitHub] [nifi] dan-s1 commented on a diff in pull request #6813: [NIFI-11006] Upgraded from Junit4 to Junit5
dan-s1 commented on code in PR #6813:
URL: https://github.com/apache/nifi/pull/6813#discussion_r1060774811
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/search/attributematchers/SearchableMatcherTest.java:
##########
@@ -25,14 +25,17 @@
import org.apache.nifi.search.SearchContext;
import org.apache.nifi.search.SearchResult;
import org.apache.nifi.search.Searchable;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
import java.util.Collection;
import java.util.HashSet;
+@MockitoSettings(strictness = Strictness.LENIENT)
Review Comment:
@ChrisSamo632 I am not aware of what you are referring to in reference to Mockito functionality. But with the upgrade to JUnit5 in my cases the unit tests were failing with an exception like the following where it actually suggests using the lenient option which I did to get these unit cases working.
```
org.mockito.exceptions.misusing.UnnecessaryStubbingException:
Unnecessary stubbings detected.
Clean & maintainable test code requires zero unnecessary code.
...
...
Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.
```
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org