You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where aTestObject is defined in another kotlin file (also in the same testset):
packagecom.xyz.company.databasetest
import ...
internalfunaTestObject(version:Long = 1L): TestObject {
returnTestObject(
id ="id",
version = version
)
}
when I run the functionalTests on command line the test fails with a NoSuchMethodError saying that aTestObject method cannot be found.
The error also occurs when I put the argument explicitly in the test (ignoring the default argument in aTestObject method)
java.lang.NoSuchMethodError: com.xyz.company....TestObjectsKt.aTestObject(J)Lcom/xyz/company/.../TestObject;
at com.....TestObjectTest$test insert into db$1.execute(TestObjectTest.kt:63)
at org.junit.jupiter.api.AssertTimeout.lambda$assertTimeout$0(AssertTimeout.java:49)
at org.junit.jupiter.api.AssertTimeout.assertTimeout(AssertTimeout.java:78)
at org.junit.jupiter.api.AssertTimeout.assertTimeout(AssertTimeout.java:66)
at org.junit.jupiter.api.AssertTimeout.assertTimeout(AssertTimeout.java:48)
at org.junit.jupiter.api.AssertTimeout.assertTimeout(AssertTimeout.java:44)
Strangely the test runs in IntelliJ.
Maybe the error occurs, because the test uses Junit5 "assertTimeout"?
The text was updated successfully, but these errors were encountered:
Hi, I've tried to recreate this and couldn't reproduce the error.
If it's working when running the test from IntelliJ, it might mean that the TestObjectKt wrapper class around your function isn't on the test classpath (because IntellIJ test runner manages its own classpath).
Could you please
check if it's working with the latest version 2.1.0 (there were some fixes to the classpath)
if it still fails, log the test testClassesDirs and classpath e.g. like this:
Hi @tkrullmann ,
I can verify that the bug has been fixed with 2.1.0. I also retested with the old version 2.0.3 where the bug still occured, just to be sure ;-)
I get a java.lang.NoSuchMethodError when I use version 2.0.3. With version 1.5.2 it works.
Using gradle 5.0 or 5.1
My test (in a testset 'functionalTest') uses a function in a package (i.e. not in a class; to create a common test object) like this:
where aTestObject is defined in another kotlin file (also in the same testset):
when I run the functionalTests on command line the test fails with a NoSuchMethodError saying that aTestObject method cannot be found.
The error also occurs when I put the argument explicitly in the test (ignoring the default argument in aTestObject method)
Strangely the test runs in IntelliJ.
Maybe the error occurs, because the test uses Junit5 "assertTimeout"?
The text was updated successfully, but these errors were encountered: