Skip to content

Commit

Permalink
测试日志打印改成info级别
Browse files Browse the repository at this point in the history
  • Loading branch information
fartherp committed Jan 19, 2020
1 parent d7091e3 commit 026c55e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ public class NoWebShiroRedissonAutoConfigurationTest extends ShiroRedissonAutoCo
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedissonAutoConfiguration.class, ShiroRedissonAutoConfiguration.class))
.withUserConfiguration(TestConfiguration.class)
.withPropertyValues("spring.redis.redisson.config:classpath:redisson.yaml",
"logging.level.org.springframework=info", "logging.level.org.redisson=info");
.withPropertyValues("spring.redis.redisson.config:classpath:redisson.yaml");

@Test
public void testDefaultCacheManager() {
this.contextRunner.run((context) -> {
assertThat(context.getBean(RedisCacheManager.class)).isNotNull();
});
this.contextRunner.run((context) -> assertThat(context.getBean(RedisCacheManager.class)).isNotNull());
}

@Test
Expand All @@ -68,9 +65,7 @@ public void testOverrideCacheManager() {

@Test
public void testDefaultSessionDAO() {
this.contextRunner.run((context) -> {
assertThat(context.getBean(SessionDAO.class)).isNotNull();
});
this.contextRunner.run((context) -> assertThat(context.getBean(SessionDAO.class)).isNotNull());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;

/**
* Created by IntelliJ IDEA.
Expand All @@ -36,6 +37,7 @@
public abstract class ShiroRedissonAutoConfigurationTest {

@Configuration
@TestPropertySource(properties = {"logging.level.org.springframework=info", "logging.level.org.redisson=info"})
protected static class TestConfiguration {
@Bean
public HashedCredentialsMatcher hashedCredentialsMatcher() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ public class WebShiroRedissonAutoConfigurationTest extends ShiroRedissonAutoConf
private WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedissonAutoConfiguration.class, ShiroRedissonAutoConfiguration.class))
.withUserConfiguration(TestConfiguration.class, Config.class)
.withPropertyValues("spring.redis.redisson.config:classpath:redisson.yaml",
"logging.level.org.springframework=info", "logging.level.org.redisson=info");
.withPropertyValues("spring.redis.redisson.config:classpath:redisson.yaml");

@Test
public void testDefaultCacheManager() {
this.contextRunner.run((context) -> {
assertThat(context.getBean(RedisCacheManager.class)).isNotNull();
});
this.contextRunner.run((context) -> assertThat(context.getBean(RedisCacheManager.class)).isNotNull());
}

@Test
Expand All @@ -75,9 +72,7 @@ public void testOverrideCacheManager() {

@Test
public void testDefaultSessionDAO() {
this.contextRunner.run((context) -> {
assertThat(context.getBean(SessionDAO.class)).isNotNull();
});
this.contextRunner.run((context) -> assertThat(context.getBean(SessionDAO.class)).isNotNull());
}

@Test
Expand Down

0 comments on commit 026c55e

Please sign in to comment.