From 2abbfaa3e5b1cbfcf8e9f8c4d27d3f6762175459 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 May 2015 21:39:59 -0400 Subject: slf4j, log4j: Fix some tests that "broke" due to Guice fixes. --- .../sangria/log4j/SangriaLog4jModuleTest.java | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'sangria-log4j/src/test/java/com') 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..ce6982b 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 @@ -57,21 +57,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 -- cgit v1.2.3 From 55e93141ff7f93cbecb341ad49d2811800569e0d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 May 2015 21:41:44 -0400 Subject: log4j: Add missing JavaDoc on test. --- .../test/java/com/tavianator/sangria/log4j/SangriaLog4jModuleTest.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sangria-log4j/src/test/java/com') 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 ce6982b..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 -- cgit v1.2.3