Hello !
I am getting R026 Failed to create Spring context error., could you please share the root cause for below error and what fix we need to apply ?
// Diffblue Cover was unable to write a Spring test,
// so wrote a non-Spring test instead.
// Reason: R026 Failed to create Spring context.
// Attempt to initialize test context failed with
// java.lang.IllegalStateException: Failed to load ApplicationContext
// at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
// at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
// at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
// at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
// at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
// org.mockito.exceptions.base.MockitoException:
// Cannot mock/spy class java.lang.Integer
// Mockito cannot mock/spy because :
// - Cannot mock wrapper types, String.class or Class.class
// at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
// at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
// at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
// at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
// at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
// See Working with code R026 | Diffblue Docs to resolve this issue.