I have a default module (HealthStatusModule) that sets up all my
bindings. One of the binding is as follows:

interface NameProvider;
class DefaultNameProvider implements NameProvider;
class TestNameProvider implements NameProvider;

In my HealthStatusModule is set the following;
bind(NameProvider.class)to(DefaultNameProvider);

What I would like to be able to do is have a TestHealthStatusModule
that extends HealthStatusModule and does the following:

public void configure(){
   super.configure();
   bind(NameProvider.class)to(TestNameProvider);
}

I read that if TestNameProvider extends DefaultNameProvider than I
could do the following:

bind (DefaultNameProvider.class)to(TestNameProvider.class);

But what about the case where my test implementation implements the
interface but does not extend the production class?

What is the standard way the modules are set up for unit testing? Is
there already a discussion about best practices for this?

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to