diff options
Diffstat (limited to 'sangria-log4j')
-rw-r--r-- | sangria-log4j/pom.xml | 2 | ||||
-rw-r--r-- | sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java | 28 |
2 files changed, 17 insertions, 13 deletions
diff --git a/sangria-log4j/pom.xml b/sangria-log4j/pom.xml index b91bb7e..2b9fe74 100644 --- a/sangria-log4j/pom.xml +++ b/sangria-log4j/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-log4j</artifactId> diff --git a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java index a3ecd66..9dbc560 100644 --- a/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java +++ b/sangria-log4j/src/test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java @@ -34,6 +34,8 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; /** + * Tests for {@link SangriaLog4jModule}. + * * @author Tavian Barnes (tavianator@tavianator.com) * @version 1.0 * @since 1.0 @@ -57,21 +59,23 @@ public class SangriaLog4jModuleTest { assertThat(provider.get().getName(), equalTo(LogManager.ROOT_LOGGER_NAME)); } + static class HasProviderMethod extends AbstractModule { + @Override + protected void configure() { + install(new SangriaLog4jModule()); + } + + @Provides + String getLoggerName(Logger logger) { + return logger.getName(); + } + } + @Test public void testProviderMethod() { - Injector injector = Guice.createInjector(new AbstractModule() { - @Override - protected void configure() { - install(new SangriaLog4jModule()); - } - - @Provides - String getLoggerName(Logger logger) { - return logger.getName(); - } - }); + Injector injector = Guice.createInjector(new HasProviderMethod()); - assertThat(injector.getInstance(String.class), equalTo(LogManager.ROOT_LOGGER_NAME)); + assertThat(injector.getInstance(String.class), equalTo(HasProviderMethod.class.getName())); } @Test |