Formatting

pull/8206/head
Andy Wilkinson 8 years ago
parent c0c575c94a
commit f34d309548

@ -60,8 +60,7 @@ public class SpringApplicationAdminJmxAutoConfiguration {
private final Environment environment; private final Environment environment;
public SpringApplicationAdminJmxAutoConfiguration( public SpringApplicationAdminJmxAutoConfiguration(
ObjectProvider<MBeanExporter> mbeanExporter, ObjectProvider<MBeanExporter> mbeanExporter, Environment environment) {
Environment environment) {
this.mbeanExporter = mbeanExporter.getIfAvailable(); this.mbeanExporter = mbeanExporter.getIfAvailable();
this.environment = environment; this.environment = environment;
} }

@ -60,8 +60,9 @@ public class CouchbaseCacheConfiguration {
public CouchbaseCacheManager cacheManager() { public CouchbaseCacheManager cacheManager() {
List<String> cacheNames = this.cacheProperties.getCacheNames(); List<String> cacheNames = this.cacheProperties.getCacheNames();
CouchbaseCacheManager cacheManager = new CouchbaseCacheManager( CouchbaseCacheManager cacheManager = new CouchbaseCacheManager(
CacheBuilder.newInstance(this.bucket).withExpiration( CacheBuilder.newInstance(this.bucket)
this.cacheProperties.getCouchbase().getExpirationSeconds()), .withExpiration(this.cacheProperties.getCouchbase()
.getExpirationSeconds()),
cacheNames.toArray(new String[cacheNames.size()])); cacheNames.toArray(new String[cacheNames.size()]));
return this.customizers.customize(cacheManager); return this.customizers.customize(cacheManager);
} }

@ -71,8 +71,8 @@ public class DataSourceAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public DataSourceInitializer dataSourceInitializer( public DataSourceInitializer dataSourceInitializer(DataSourceProperties properties,
DataSourceProperties properties, ApplicationContext applicationContext) { ApplicationContext applicationContext) {
return new DataSourceInitializer(properties, applicationContext); return new DataSourceInitializer(properties, applicationContext);
} }

@ -60,7 +60,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
private boolean initialized = false; private boolean initialized = false;
DataSourceInitializer(DataSourceProperties properties, ApplicationContext applicationContext) { DataSourceInitializer(DataSourceProperties properties,
ApplicationContext applicationContext) {
this.properties = properties; this.properties = properties;
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

@ -107,7 +107,6 @@ public class AopAutoConfigurationTests {
this.context = ctx; this.context = ctx;
} }
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
@Configuration @Configuration
@Import(TestConfiguration.class) @Import(TestConfiguration.class)

@ -66,8 +66,9 @@ public class CassandraAutoConfigurationTests {
public void createCustomizeCluster() { public void createCustomizeCluster() {
load(MockCustomizerConfig.class); load(MockCustomizerConfig.class);
assertThat(this.context.getBeanNamesForType(Cluster.class).length).isEqualTo(1); assertThat(this.context.getBeanNamesForType(Cluster.class).length).isEqualTo(1);
assertThat(this.context.getBeanNamesForType(ClusterBuilderCustomizer.class).length) assertThat(
.isEqualTo(1); this.context.getBeanNamesForType(ClusterBuilderCustomizer.class).length)
.isEqualTo(1);
} }
@Test @Test

@ -184,24 +184,24 @@ public class JpaPropertiesTests {
@Test @Test
public void determineDatabaseWithKnownUrl() { public void determineDatabaseWithKnownUrl() {
JpaProperties properties = load(HibernateVersion.V5); JpaProperties properties = load(HibernateVersion.V5);
Database database = properties.determineDatabase( Database database = properties
mockDataSource("jdbc:h2:mem:testdb")); .determineDatabase(mockDataSource("jdbc:h2:mem:testdb"));
assertThat(database).isEqualTo(Database.H2); assertThat(database).isEqualTo(Database.H2);
} }
@Test @Test
public void determineDatabaseWithKnownUrlAndUserConfig() { public void determineDatabaseWithKnownUrlAndUserConfig() {
JpaProperties properties = load(HibernateVersion.V5, "spring.jpa.database=mysql"); JpaProperties properties = load(HibernateVersion.V5, "spring.jpa.database=mysql");
Database database = properties.determineDatabase( Database database = properties
mockDataSource("jdbc:h2:mem:testdb")); .determineDatabase(mockDataSource("jdbc:h2:mem:testdb"));
assertThat(database).isEqualTo(Database.MYSQL); assertThat(database).isEqualTo(Database.MYSQL);
} }
@Test @Test
public void determineDatabaseWithUnknownUrl() { public void determineDatabaseWithUnknownUrl() {
JpaProperties properties = load(HibernateVersion.V5); JpaProperties properties = load(HibernateVersion.V5);
Database database = properties.determineDatabase( Database database = properties
mockDataSource("jdbc:unknown://localhost")); .determineDatabase(mockDataSource("jdbc:unknown://localhost"));
assertThat(database).isEqualTo(Database.DEFAULT); assertThat(database).isEqualTo(Database.DEFAULT);
} }
@ -222,7 +222,7 @@ public class JpaPropertiesTests {
given(ds.getConnection()).willReturn(connection); given(ds.getConnection()).willReturn(connection);
} }
catch (SQLException e) { catch (SQLException e) {
//Do nothing // Do nothing
} }
return ds; return ds;
} }

@ -39,8 +39,8 @@ public class SampleController {
@GetMapping("/") @GetMapping("/")
@ResponseBody @ResponseBody
public Map<String, String> hello() { public Map<String, String> hello() {
return Collections.singletonMap("message", "Hello " + return Collections.singletonMap("message",
this.helloWorldProperties.getName()); "Hello " + this.helloWorldProperties.getName());
} }
protected static class Message { protected static class Message {

@ -163,10 +163,10 @@ public abstract class SpringBootServletInitializer implements WebApplicationInit
} }
/** /**
* Configure the application. Normally all you would need to do is to add sources (e.g. * Configure the application. Normally all you would need to do is to add sources
* config classes) because other settings have sensible defaults. You might choose * (e.g. config classes) because other settings have sensible defaults. You might
* (for instance) to add default command line arguments, or set an active Spring * choose (for instance) to add default command line arguments, or set an active
* profile. * Spring profile.
* @param builder a builder for the application context * @param builder a builder for the application context
* @return the application builder * @return the application builder
* @see SpringApplicationBuilder * @see SpringApplicationBuilder

@ -144,8 +144,8 @@ public class SpringProfileDocumentMatcher implements DocumentMatcher {
} }
/** /**
* {@link ProfilesMatcher} that matches when a value in {@code spring.profiles} is also * {@link ProfilesMatcher} that matches when a value in {@code spring.profiles} is
* in {@code spring.profiles.active}. * also in {@code spring.profiles.active}.
*/ */
private static class ActiveProfilesMatcher extends ProfilesMatcher { private static class ActiveProfilesMatcher extends ProfilesMatcher {

Loading…
Cancel
Save