summaryrefslogtreecommitdiffstats
path: root/sangria-slf4j/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'sangria-slf4j/src/test/java/com')
-rw-r--r--sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java b/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java
index aaf72b2..07bf068 100644
--- a/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java
+++ b/sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java
@@ -58,21 +58,23 @@ public class SangriaSlf4jModuleTest {
assertThat(provider.get().getName(), equalTo(Logger.ROOT_LOGGER_NAME));
}
+ static class HasProviderMethod extends AbstractModule {
+ @Override
+ protected void configure() {
+ install(new SangriaSlf4jModule());
+ }
+
+ @Provides
+ String getLoggerName(Logger logger) {
+ return logger.getName();
+ }
+ }
+
@Test
public void testProviderMethod() {
- Injector injector = Guice.createInjector(new AbstractModule() {
- @Override
- protected void configure() {
- install(new SangriaSlf4jModule());
- }
-
- @Provides
- String getLoggerName(Logger logger) {
- return logger.getName();
- }
- });
+ Injector injector = Guice.createInjector(new HasProviderMethod());
- assertThat(injector.getInstance(String.class), equalTo(Logger.ROOT_LOGGER_NAME));
+ assertThat(injector.getInstance(String.class), equalTo(HasProviderMethod.class.getName()));
}
@Test