google / google/guice

spy() all guice created instances (in test cases)

Open
#1,286 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.7k
Forks
1.7k
Avg merge
11m
Merged PRs (30d)
2

Description

I am using Guice for DI in my application. While writing test cases also, I want to use Guice for dependency injection. Now most of the time I want to inject original instances, however in some test cases, I want to spy() out the injector created instances to control instance behaviour.

Is it possible to spy() all instances created by injector so that individual test cases can enforce selective behaviour while maintaining normal behaviour everywhere else ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.