Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Another issue comes up in Sling GraphQL Core when it tries to mock classes like Resource Resolver:

Underlying exception : org.mockito.exceptions.base.MockitoException: Could not modify all classes [interface java.io.Closeable, interface java.lang.AutoCloseable, interface org.apache.sling.api.resource.ResourceResolver]

at org.apache.sling.graphql.core.schema.RankedSchemaProvidersTest.setup(RankedSchemaProvidersTest.java:54)

When I upgrade to the latest Mockito-inline (5.2.0) from 3.5.11 then the instrumentation does work but the Pax IT test all time out because it is unable to lookup Sling services:

[INFO] Running org.apache.sling.graphql.core.it.GraphQLScriptEngineIT

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 21.341 s <<< FAILURE! - in org.apache.sling.graphql.core.it.GraphQLScriptEngineIT

[ERROR] org.apache.sling.graphql.core.it.GraphQLScriptEngineIT.testEnginePresent  Time elapsed: 10.114 s  <<< ERROR!

org.ops4j.pax.swissbox.tracker.ServiceLookupException: gave up waiting for service javax.script.ScriptEngineFactory

at org.ops4j.pax.swissbox.tracker.ServiceLookup.getService(ServiceLookup.java:199)

Remediation: Pending

Examples:

Failure with OSGi Converter

...