Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticMockHandler not found when calling a static method on a spied object #382

Open
mimkorn opened this issue Sep 11, 2023 · 0 comments
Open

Comments

@mimkorn
Copy link

mimkorn commented Sep 11, 2023

I get

Caused by: java.lang.NoClassDefFoundError: io/github/joke/spockmockable/agent/StaticMockHandler
	at java.base/java.time.LocalDateTime.of(LocalDateTime.java:374)
	at java.base/java.time.LocalDateTime.<clinit>(LocalDateTime.java:144)
	at jdk.zipfs/jdk.nio.zipfs.ZipUtils.dosToJavaTime(ZipUtils.java:118)
	....

when running this minimal test:

import spock.lang.Specification
import java.time.LocalDateTime

class ExperimentSpecTest extends Specification {

    def "test"() {
        def of = LocalDateTime.of(2023, 1, 2, 3, 4)
        def spyTime = Spy(LocalDateTime)
    }
}

Using Spock 2.1, spock-mockable 2.3.2

The order of calls does not matter.

The whole test execution crashes, so no tests run at all with that failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant