Binding an Interface to its Implementation (Annotated with Singleton) at Multiple location
61 views
Skip to first unread message
Mehul Jain
unread,
May 1, 2020, 4:37:43 AM5/1/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-guice
I am getting error - A binding to XX was already configured at YY. How can I have the same Interface binded to its Implementation at multiple location. The reason I want to do this when I do Unit Testing I want to have binding for each Class that I am testing otherwise I can always get away with having binding at one place.
Jeuxjeux20 Y
unread,
Jul 3, 2020, 10:06:36 AM7/3/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-guice
Hi,
You can try to use Modules.override(yourModule).with(testModule) to override yourModule's bindings with those in testModule.