diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2015-05-06 21:55:51 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2015-05-06 21:55:51 -0400 |
commit | d08927582d2c36e3da20488df8f262ca03f26c81 (patch) | |
tree | 766ba74d26a766a2046499bac3a137fbd332647a /sangria-slf4j | |
parent | 173ef17d37be1f8bd583fbc0e527b2a81ff9f6d9 (diff) | |
parent | 55e93141ff7f93cbecb341ad49d2811800569e0d (diff) | |
download | sangria-d08927582d2c36e3da20488df8f262ca03f26c81.tar.xz |
Merge branch 'guice-4-release'
Diffstat (limited to 'sangria-slf4j')
-rw-r--r-- | sangria-slf4j/pom.xml | 2 | ||||
-rw-r--r-- | sangria-slf4j/src/test/java/com/tavianator/sangria/slf4j/SangriaSlf4jModuleTest.java | 26 |
2 files changed, 15 insertions, 13 deletions
diff --git a/sangria-slf4j/pom.xml b/sangria-slf4j/pom.xml index 53cbfb7..41d6647 100644 --- a/sangria-slf4j/pom.xml +++ b/sangria-slf4j/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>com.tavianator.sangria</groupId> <artifactId>sangria</artifactId> - <version>1.2-SNAPSHOT</version> + <version>1.3-SNAPSHOT</version> </parent> <artifactId>sangria-slf4j</artifactId> 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 |