Skip to content

Commit

Permalink
Merge pull request #201 from brharrington/eureka-client
Browse files Browse the repository at this point in the history
verify guice inject works with EurekaClient
  • Loading branch information
brharrington committed Nov 26, 2015
2 parents 920c36a + 6c0a183 commit 1556e1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.google.inject.Inject;
import com.netflix.appinfo.HealthCheckHandler;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.iep.service.ServiceManager;

import javax.inject.Provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.discovery.EurekaClient;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -33,4 +34,11 @@ public void getClient() {
Assert.assertNotNull(client);
}

@Test
public void getEurekaClient() {
Injector injector = Guice.createInjector(new EurekaModule());
EurekaClient client = injector.getInstance(EurekaClient.class);
Assert.assertNotNull(client);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.google.inject.Inject;
import com.google.inject.Provides;
import com.netflix.config.ConfigurationManager;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.discovery.EurekaClient;
import com.netflix.iep.http.BasicServerRegistry;
import com.netflix.iep.http.EurekaServerRegistry;
import com.netflix.iep.http.RxHttp;
Expand All @@ -41,7 +41,7 @@ private static class OptionalInjections {
Configuration configuration;

@Inject(optional = true)
DiscoveryClient discovery;
EurekaClient discovery;

OptionalInjections() {
}
Expand Down

0 comments on commit 1556e1f

Please sign in to comment.