From ae1f95e6d2716319e89c57db69d3d5d32c21e0ad Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 23 Sep 2017 06:44:08 +0100 Subject: [PATCH] Start building against Spring Framework snapshots for 5.0.0.RELEASE See gh-10325 --- spring-boot-dependencies/pom.xml | 2 +- spring-boot/pom.xml | 5 ++++ .../boot/StartUpLoggerTests.java | 24 ++++++++----------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 37762f8bac..cd7dfd4762 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -162,7 +162,7 @@ 1.7.25 1.18 6.6.1 - 5.0.0.RC4 + 5.0.0.BUILD-SNAPSHOT 2.0.0.RC1 2.0.0.M1 4.0.0.M3 diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 0a4d473633..94d046d555 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -351,6 +351,11 @@ mariadb-java-client test + + org.mockito + mockito-core + test + org.postgresql postgresql diff --git a/spring-boot/src/test/java/org/springframework/boot/StartUpLoggerTests.java b/spring-boot/src/test/java/org/springframework/boot/StartUpLoggerTests.java index dc467ed1df..06ca1a0c08 100644 --- a/spring-boot/src/test/java/org/springframework/boot/StartUpLoggerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/StartUpLoggerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,33 +16,29 @@ package org.springframework.boot; -import org.apache.commons.logging.impl.SimpleLog; +import org.apache.commons.logging.Log; import org.junit.Test; -import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; /** * Tests for {@link StartupInfoLogger}. * * @author Dave Syer + * @author Andy Wilkinson */ public class StartUpLoggerTests { - private final StringBuffer output = new StringBuffer(); - - @SuppressWarnings("serial") - private final SimpleLog log = new SimpleLog("test") { - @Override - protected void write(StringBuffer buffer) { - StartUpLoggerTests.this.output.append(buffer).append("\n"); - }; - }; + private final Log log = mock(Log.class); @Test public void sourceClassIncluded() { + given(this.log.isInfoEnabled()).willReturn(true); new StartupInfoLogger(getClass()).logStarting(this.log); - assertThat(this.output.toString()) - .contains("Starting " + getClass().getSimpleName()); + verify(this.log).info(startsWith("Starting " + getClass().getSimpleName())); } }