[
https://issues.apache.org/jira/browse/NIFI-5289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16536419#comment-16536419
]
ASF GitHub Bot commented on NIFI-5289:
--------------------------------------
Github user MartinPayne commented on the issue:
https://github.com/apache/nifi/pull/2780
@MikeThomsen I'm not too sure what you mean. At the moment you'll get a
NoClassDefFoundError unless JUnit 4 happens to be on the test classpath (it
won't be on the test classpath if you're using JUnit 5). That's because
nifi-mock declares JUnit 4 with a "provided" scope, when there is nothing
providing JUnit 4. It should be "compile" scope, because nifi-mock is making
use of JUnit assertions in non-test code.
> NoClassDefFoundError for org.junit.Assert When Using nifi-mock
> --------------------------------------------------------------
>
> Key: NIFI-5289
> URL: https://issues.apache.org/jira/browse/NIFI-5289
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.6.0
> Reporter: Martin Payne
> Priority: Minor
>
> When using the NiFi Mock framework but not using JUnit 4, tests fail with a
> NoClassDefFoundError for org.junit.Assert. This is because nifi-mock sets the
> scope of junit to "provided", which means it's not pulled into consuming
> projects as a transitive dependency. It should be set to "compile" so that
> users don't have to set an explicit JUnit dependency in their projects.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)