#in java how to use Spy for a class with no no-arg constructor

3 messages · Page 1 of 1 (latest)

tall tartan
#

when i use @Spy annotation i get this error,

Please ensure that the type 'VideoTranscriptService' has a no-arg constructor.

i need to use it as im mocking static classes in there, but it doesnt seem to work for classes with no no-arg constructor.

north hazelBOT
#

This post has been reserved for your question.

Hey @tall tartan! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.