Hi Leon, Sorry for the late reply. Seems like a version mismatch for mockito.. I see you are already trying to exclude it though.. Could you share the full stack trace?
On Mon, May 18, 2020 at 1:12 PM Lian Jiang <[email protected]> wrote: > Hi, > > I am using hudi in a scala gradle project: > > dependencies { > compile group: 'org.apache.spark', name: 'spark-core_2.11', version: > '2.4.4' > compile group: 'org.apache.spark', name: 'spark-sql_2.11', version: > '2.4.4' > compile group: 'org.scala-lang', name: 'scala-library', version: > '2.11.11' > compile group: 'com.github.scopt', name: 'scopt_2.11', version: '3.7.1' > compile group: 'org.apache.spark', name: 'spark-avro_2.11', version: > '2.4.4' > compile group: 'com.amazonaws', name: 'aws-java-sdk', version: > '1.11.297' > compile group: 'com.zillow.datacontracts', name: > 'contract-evaluation-library', version: '0.1.0.master.98a438b' > compile (group: 'org.apache.hudi', name: 'hudi-spark_2.11', > version: '0.5.1-incubating') { > exclude group: 'org.scala-lang', module: 'scala-library' > exclude group: 'org.scalatest', module: 'scalatest_2.12' > } > > testCompile group: 'junit', name: 'junit', version: '4.12' > testCompile group: 'org.scalatest', name: 'scalatest_2.11', > version: '3.2.0-SNAP7' > testCompile group: 'org.mockito', name: 'mockito-scala_2.11', > version: '1.5.12' > } > > Below code throws exception ' > java.lang.NoSuchMethodError: > > org.scalatest.mockito.MockitoSugar.$init$(Lorg/scalatest/mockito/MockitoSugar;)V' > > import org.junit.runner.RunWith > import org.scalatest.FunSuite > import org.scalatest.junit.JUnitRunner > import org.scalatest.mockito.MockitoSugar > > @RunWith(classOf[JUnitRunner]) > class BaseTest extends FunSuite with MockitoSugar { > } > > Removing org.apache.hudi from the dependency list will make the code > work. Does anybody know how to include hudi dependency without > conflicting with the test? > > Appreciate any help! > > Regards > > Leon >
