Formatting

pull/5290/head
Phillip Webb 9 years ago
parent 79922360e1
commit 93382648ab

@ -64,8 +64,7 @@ public class SpringApplicationHierarchyTests {
@EnableAutoConfiguration(exclude = { ElasticsearchDataAutoConfiguration.class,
ElasticsearchRepositoriesAutoConfiguration.class,
CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
Neo4jAutoConfiguration.class,
RedisAutoConfiguration.class,
Neo4jAutoConfiguration.class, RedisAutoConfiguration.class,
RedisRepositoriesAutoConfiguration.class }, excludeName = {
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
public static class Child {
@ -77,8 +76,7 @@ public class SpringApplicationHierarchyTests {
ElasticsearchDataAutoConfiguration.class,
ElasticsearchRepositoriesAutoConfiguration.class,
CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
Neo4jAutoConfiguration.class,
RedisAutoConfiguration.class,
Neo4jAutoConfiguration.class, RedisAutoConfiguration.class,
RedisRepositoriesAutoConfiguration.class }, excludeName = {
"org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration" })
public static class Parent {

@ -57,7 +57,8 @@ public class PrefixMetricGroupExporterTests {
this.reader.set(new Metric<Number>("counter.foo.bar", 1));
this.exporter.setGroups(Collections.singleton("counter.foo"));
this.exporter.export();
assertThat(this.writer.findAll("counter.foo").iterator().next().getValue()).isEqualTo(2L);
assertThat(this.writer.findAll("counter.foo").iterator().next().getValue())
.isEqualTo(2L);
}
@Test

@ -143,8 +143,8 @@ public class EnableAutoConfigurationImportSelector
List<String> configurations = SpringFactoriesLoader.loadFactoryNames(
getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
Assert.notEmpty(configurations,
"No auto configuration classes found in META-INF/spring.factories. If you" +
"are using a custom packaging, make sure that file is correct.");
"No auto configuration classes found in META-INF/spring.factories. If you"
+ "are using a custom packaging, make sure that file is correct.");
return configurations;
}

@ -100,7 +100,8 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
+ matching);
}
matchMessage.append("@ConditionalOnSingleCandidate ").append(spec)
.append(" found a primary candidate amongst the following ").append(matching);
.append(" found a primary candidate amongst the following ")
.append(matching);
}
if (metadata.isAnnotated(ConditionalOnMissingBean.class.getName())) {
BeanSearchSpec spec = new BeanSearchSpec(context, metadata,

@ -73,8 +73,9 @@ class OnClassCondition extends SpringBootCondition {
}
matchMessage.append(matchMessage.length() == 0 ? "" : " ");
matchMessage.append("@ConditionalOnMissing classes not found: ")
.append(StringUtils.collectionToCommaDelimitedString(getMatchingClasses(
onMissingClasses, MatchType.MISSING, context)));
.append(StringUtils.collectionToCommaDelimitedString(
getMatchingClasses(onMissingClasses, MatchType.MISSING,
context)));
}
return ConditionOutcome.match(matchMessage.toString());

@ -83,8 +83,8 @@ class OnPropertyCondition extends SpringBootCondition {
StringBuilder message = new StringBuilder("@ConditionalOnProperty ");
if (!missingProperties.isEmpty()) {
message.append("missing required properties ").append(expandNames(prefix, missingProperties))
.append(" ");
message.append("missing required properties ")
.append(expandNames(prefix, missingProperties)).append(" ");
}
if (!nonMatchingProperties.isEmpty()) {
String expected = StringUtils.hasLength(havingValue) ? havingValue : "!false";

@ -18,4 +18,3 @@
* Auto-configuration for Spring Data Neo4j.
*/
package org.springframework.boot.autoconfigure.data.neo4j;

@ -188,7 +188,8 @@ public class ActiveMQProperties {
private Boolean trustAll;
/**
* Comma-separated list of specific packages to trust (when not trusting all packages).
* Comma-separated list of specific packages to trust (when not trusting all
* packages).
*/
private List<String> trusted = new ArrayList<String>();

@ -153,7 +153,8 @@ public class EnableAutoConfigurationImportSelectorTests {
@Test
public void propertyOverrideSetToTrue() throws Exception {
configureExclusions(new String[0], new String[0], new String[0]);
this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, "true");
this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY,
"true");
String[] imports = this.importSelector.selectImports(this.annotationMetadata);
assertThat(imports).isNotEmpty();
}
@ -161,7 +162,8 @@ public class EnableAutoConfigurationImportSelectorTests {
@Test
public void propertyOverrideSetToFalse() throws Exception {
configureExclusions(new String[0], new String[0], new String[0]);
this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, "false");
this.environment.setProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY,
"false");
String[] imports = this.importSelector.selectImports(this.annotationMetadata);
assertThat(imports).isEmpty();
}

@ -61,12 +61,14 @@ public class IntegrationAutoConfigurationTests {
@Test
public void parentContext() {
this.context = new AnnotationConfigApplicationContext();
this.context.register(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class);
this.context.register(JmxAutoConfiguration.class,
IntegrationAutoConfiguration.class);
this.context.refresh();
AnnotationConfigApplicationContext parent = this.context;
this.context = new AnnotationConfigApplicationContext();
this.context.setParent(parent);
this.context.register(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class);
this.context.register(JmxAutoConfiguration.class,
IntegrationAutoConfiguration.class);
this.context.refresh();
assertThat(this.context.getBean(HeaderChannelRegistry.class)).isNotNull();
((ConfigurableApplicationContext) this.context.getParent()).close();

@ -40,8 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith(SpringRunner.class)
@DirtiesContext
@SpringBootTest(webEnvironment = WebEnvironment.NONE, properties = {
"env.foo=There", "foo=World" })
@SpringBootTest(webEnvironment = WebEnvironment.NONE, properties = { "env.foo=There",
"foo=World" })
public class MustacheStandaloneIntegrationTests {
@Autowired

@ -26,9 +26,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.TypeExcludeFilter;
/**
* Annotation that can be on tests to define a set of {@link TypeExcludeFilter} classes that
* should be applied to {@link SpringBootApplication @SpringBootApplication} component
* scanning.
* Annotation that can be on tests to define a set of {@link TypeExcludeFilter} classes
* that should be applied to {@link SpringBootApplication @SpringBootApplication}
* component scanning.
*
* @author Phillip Webb
* @since 1.4.0

@ -25,8 +25,8 @@ import java.lang.annotation.Target;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
/**
* Annotation that can be applied to a test class to enable
* auto-configuration of a {@link TestEntityManager}.
* Annotation that can be applied to a test class to enable auto-configuration of a
* {@link TestEntityManager}.
*
* @author Phillip Webb
* @see TestEntityManagerAutoConfiguration

@ -47,9 +47,9 @@ import org.springframework.transaction.annotation.Transactional;
* override these settings.
* <p>
* If you are looking to load your full application configuration, but use an embedded
* database, you should consider {@link SpringBootTest @SpringBootTest}
* combined with {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than
* this annotation.
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
* annotation.
*
* @author Phillip Webb
* @see AutoConfigureTestDatabase

@ -37,8 +37,8 @@ import org.springframework.web.servlet.DispatcherServlet;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Base class for {@link SpringBootTest} tests configured to start an embedded
* servlet container
* Base class for {@link SpringBootTest} tests configured to start an embedded servlet
* container
*
* @author Phillip Webb
* @author Andy Wilkinson

@ -26,8 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
/**
* Tests for {@link SpringBootTest} configured with
* {@link WebEnvironment#DEFINED_PORT}.
* Tests for {@link SpringBootTest} configured with {@link WebEnvironment#DEFINED_PORT}.
*
* @author Phillip Webb
* @author Andy Wilkinson

@ -26,16 +26,14 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
/**
* Tests for {@link SpringBootTest} configured with
* {@link WebEnvironment#DEFINED_PORT}.
* Tests for {@link SpringBootTest} configured with {@link WebEnvironment#DEFINED_PORT}.
*
* @author Phillip Webb
* @author Andy Wilkinson
*/
@RunWith(SpringRunner.class)
@DirtiesContext
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
"value=123" })
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "value=123" })
public class SpringBootTestWebEnvironmentRandomPortTests
extends AbstractSpringBootTestEmbeddedWebEnvironmentTests {

@ -289,8 +289,7 @@ public class JsonContentAssertTests {
}
@Test
public void isEqualToJsonWhenStringIsMatchingAndLenientShouldPass()
throws Exception {
public void isEqualToJsonWhenStringIsMatchingAndLenientShouldPass() throws Exception {
assertThat(forJson(SOURCE)).isEqualToJson(LENIENT_SAME, JSONCompareMode.LENIENT);
}
@ -329,8 +328,7 @@ public class JsonContentAssertTests {
}
@Test
public void isEqualToJsonWhenBytesAreMatchingAndLenientShouldPass()
throws Exception {
public void isEqualToJsonWhenBytesAreMatchingAndLenientShouldPass() throws Exception {
assertThat(forJson(SOURCE)).isEqualToJson(LENIENT_SAME.getBytes(),
JSONCompareMode.LENIENT);
}

@ -22,8 +22,8 @@ import org.springframework.context.annotation.Import;
/**
* Config for {@link MockBeanOnTestFieldForExistingBeanIntegrationTests} and
* {@link MockBeanOnTestFieldForExistingBeanCacheIntegrationTests}. Extracted to a shared config
* to trigger caching.
* {@link MockBeanOnTestFieldForExistingBeanCacheIntegrationTests}. Extracted to a shared
* config to trigger caching.
*
* @author Phillip Webb
*/

@ -615,9 +615,8 @@ public class JettyEmbeddedServletContainerFactory
}
/**
* Set a Jetty {@link ThreadPool} that should be used by the {@link Server}.
* If set to {@code null} (default), the {@link Server} creates
* a {@link ThreadPool} implicitly.
* Set a Jetty {@link ThreadPool} that should be used by the {@link Server}. If set to
* {@code null} (default), the {@link Server} creates a {@link ThreadPool} implicitly.
* @param threadPool a Jetty ThreadPool to be used
*/
public void setThreadPool(ThreadPool threadPool) {
@ -898,7 +897,8 @@ public class JettyEmbeddedServletContainerFactory
public Server createServer(ThreadPool threadPool) {
Server server = new Server();
try {
ReflectionUtils.findMethod(Server.class, "setThreadPool", ThreadPool.class)
ReflectionUtils
.findMethod(Server.class, "setThreadPool", ThreadPool.class)
.invoke(server, threadPool);
}
catch (Exception e) {

@ -76,8 +76,8 @@ public abstract class JsonObjectDeserializer<T>
throws IOException;
/**
* Helper method to extract a value from the given {@code jsonNode} or return {@code null}
* when the node itself is {@code null}.
* Helper method to extract a value from the given {@code jsonNode} or return
* {@code null} when the node itself is {@code null}.
* @param jsonNode the source node (may be {@code null}
* @param type the data type. May be {@link String}, {@link Boolean}, {@link Long},
* {@link Integer}, {@link Short}, {@link Double}, {@link Float}, {@link BigDecimal}

@ -157,7 +157,8 @@ public class ImageBannerTests {
}
@Test
public void printBannerWhenHasMarginPropertyShouldPrintSizedMargin() throws Exception {
public void printBannerWhenHasMarginPropertyShouldPrintSizedMargin()
throws Exception {
AnsiOutput.setEnabled(AnsiOutput.Enabled.NEVER);
String banner = printBanner("large.gif", "banner.image.margin=4");
String[] lines = banner.split(NEW_LINE);

@ -72,7 +72,8 @@ public class SpringBootJoranConfiguratorTests {
@After
public void reset() {
this.context.stop();
new BasicConfigurator().configure((LoggerContext) LoggerFactory.getILoggerFactory());
new BasicConfigurator()
.configure((LoggerContext) LoggerFactory.getILoggerFactory());
}
@Test

@ -58,12 +58,12 @@ public class NodeEntityScanTests {
this.thrown.expectMessage("Unable to configure "
+ "SessionFactoryFactoryBean from @NodeEntityScan, "
+ "ensure an appropriate bean is registered.");
this.context = new AnnotationConfigApplicationContext(MissingSessionFactory.class);
this.context = new AnnotationConfigApplicationContext(
MissingSessionFactory.class);
}
private void assertSetPackagesToScan(String... expected) {
String[] actual = this.context
.getBean(TestSessionFactoryProvider.class)
String[] actual = this.context.getBean(TestSessionFactoryProvider.class)
.getPackagesToScan();
assertThat(actual).isEqualTo(expected);
}
@ -87,9 +87,7 @@ public class NodeEntityScanTests {
static class MissingSessionFactory {
}
private static class TestSessionFactoryProvider
extends SessionFactoryProvider {
private static class TestSessionFactoryProvider extends SessionFactoryProvider {
private String[] packagesToScan;

@ -63,7 +63,8 @@ public class InternalOutputCapture implements TestRule {
try {
if (!InternalOutputCapture.this.matchers.isEmpty()) {
String output = InternalOutputCapture.this.toString();
Assert.assertThat(output, allOf(InternalOutputCapture.this.matchers));
Assert.assertThat(output,
allOf(InternalOutputCapture.this.matchers));
}
}
finally {

Loading…
Cancel
Save