jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
465 stars 240 forks source link

@Mocked messes up maven surefire-plugin #383

Closed yangyangyyy closed 7 years ago

yangyangyyy commented 7 years ago

Please provide the following information: I have the following code, it runs fine in maven and intellij, but the final report to mvn test

surefire plugin seems to be lost. in the following code, if I uncomment the def line, the assert still happens and fails, but the mvn test output says no tests were executed, instead of say run 1 failed 1

import mockit.Mocked
import org.junit.Test
import org.scalatest.junit.AssertionsForJUnit

class SuperSimpleTest extends AssertionsForJUnit {

  class Class1 {
    def fun(): Int = {
      1
    }
  }
  @Test
//  def testSimple(@Mocked a:Class1): Unit = {
  def testSimple(): Unit = {
    assert(1 == 2 , "fake")
  }

}
yangyangyyy commented 7 years ago

btw this is scala