diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java index eecfbda378..154d7e9fb1 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java @@ -183,14 +183,15 @@ public class EndpointWebMvcManagementContextConfiguration { AnnotatedTypeMetadata metadata) { Environment environment = context.getEnvironment(); String config = environment.resolvePlaceholders("${logging.file:}"); - ConditionMessage.Builder message = ConditionMessage - .forCondition("Log File"); + ConditionMessage.Builder message = ConditionMessage.forCondition("Log File"); if (StringUtils.hasText(config)) { - return ConditionOutcome.match(message.found("logging.file").items(config)); + return ConditionOutcome + .match(message.found("logging.file").items(config)); } config = environment.resolvePlaceholders("${logging.path:}"); if (StringUtils.hasText(config)) { - return ConditionOutcome.match(message.found("logging.path").items(config)); + return ConditionOutcome + .match(message.found("logging.path").items(config)); } config = new RelaxedPropertyResolver(environment, "endpoints.logfile.") .getProperty("external-file"); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java index d596cbd90e..a15772492c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java @@ -98,7 +98,8 @@ import org.springframework.mail.javamail.JavaMailSenderImpl; MongoDataAutoConfiguration.class, RabbitAutoConfiguration.class, RedisAutoConfiguration.class, SolrAutoConfiguration.class }) @EnableConfigurationProperties({ HealthIndicatorProperties.class }) -@Import({ ElasticsearchHealthIndicatorConfiguration.ElasticsearchClientHealthIndicatorConfiguration.class, +@Import({ + ElasticsearchHealthIndicatorConfiguration.ElasticsearchClientHealthIndicatorConfiguration.class, ElasticsearchHealthIndicatorConfiguration.ElasticsearchJestHealthIndicatorConfiguration.class }) public class HealthIndicatorAutoConfiguration { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/InfoContributorProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/InfoContributorProperties.java index a190908ad3..26a2ecc694 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/InfoContributorProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/InfoContributorProperties.java @@ -34,7 +34,6 @@ public class InfoContributorProperties { return this.git; } - public static class Git { /** diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java index 1e6e45ea88..f7ad0fa02d 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/JolokiaAutoConfiguration.java @@ -98,8 +98,7 @@ public class JolokiaAutoConfiguration { public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { boolean endpointsEnabled = isEnabled(context, "endpoints.", true); - ConditionMessage.Builder message = ConditionMessage - .forCondition("Jolokia"); + ConditionMessage.Builder message = ConditionMessage.forCondition("Jolokia"); if (isEnabled(context, "endpoints.jolokia.", endpointsEnabled)) { return ConditionOutcome.match(message.because("enabled")); } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java index a69ccd75f4..6359f7e0ae 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java @@ -17,8 +17,7 @@ package org.springframework.boot.actuate.autoconfigure; import java.net.InetAddress; -import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; import javax.validation.constraints.NotNull; @@ -179,7 +178,7 @@ public class ManagementServerProperties implements SecurityPrerequisite { /** * Comma-separated list of roles that can access the management endpoint. */ - private List roles = new ArrayList(Collections.singletonList("ADMIN")); + private List roles = Arrays.asList("ADMIN"); /** * Session creating policy to use (always, never, if_required, stateless). diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java index 7bca00b49e..937ab513a1 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfigurationTests.java @@ -398,9 +398,9 @@ public class HealthIndicatorAutoConfigurationTests { EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); - this.context.register(JestClientConfiguration.class, - JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class, - ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); + this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class, + ElasticsearchAutoConfiguration.class, ManagementServerProperties.class, + HealthIndicatorAutoConfiguration.class); this.context.refresh(); Map beans = this.context @@ -414,9 +414,8 @@ public class HealthIndicatorAutoConfigurationTests { public void elasticsearchJestHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, "management.health.diskspace.enabled:false"); - this.context.register(JestClientConfiguration.class, - JestAutoConfiguration.class, ManagementServerProperties.class, - HealthIndicatorAutoConfiguration.class); + this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class, + ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); this.context.refresh(); Map beans = this.context @@ -432,9 +431,9 @@ public class HealthIndicatorAutoConfigurationTests { "management.health.elasticsearch.enabled:false", "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); - this.context.register(JestClientConfiguration.class, - JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class, - ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); + this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class, + ElasticsearchAutoConfiguration.class, ManagementServerProperties.class, + HealthIndicatorAutoConfiguration.class); this.context.refresh(); Map beans = this.context diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java index d04616a486..3fa42be8c4 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ManagementServerPropertiesAutoConfigurationTests.java @@ -82,8 +82,7 @@ public class ManagementServerPropertiesAutoConfigurationTests { @Test public void managementRolesAllowsIndexedAccess() { - ManagementServerProperties properties = load( - "management.security.roles[0]=FOO"); + ManagementServerProperties properties = load("management.security.roles[0]=FOO"); assertThat(properties.getSecurity().getRoles()).containsOnly("FOO"); } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java index 725b1b24e1..632ad65f35 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/security/AuthorizationAuditListenerTests.java @@ -73,8 +73,8 @@ public class AuthorizationAuditListenerTests { @Test public void testDetailsAreIncludedInAuditEvent() throws Exception { Object details = new Object(); - UsernamePasswordAuthenticationToken authentication = - new UsernamePasswordAuthenticationToken("user", "password"); + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( + "user", "password"); authentication.setDetails(details); this.listener.onApplicationEvent(new AuthorizationFailureEvent(this, Arrays.asList(new SecurityConfig("USER")), diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java index 0882cf7f33..8d6538d320 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/JCacheCacheConfiguration.java @@ -178,8 +178,7 @@ class JCacheCacheConfiguration { @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { - ConditionMessage.Builder message = ConditionMessage - .forCondition("JCache"); + ConditionMessage.Builder message = ConditionMessage.forCondition("JCache"); RelaxedPropertyResolver resolver = new RelaxedPropertyResolver( context.getEnvironment(), "spring.cache.jcache."); if (resolver.containsProperty("provider")) { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java index c6a12bf36d..65a410892c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java @@ -375,8 +375,8 @@ public final class ConditionMessage { /** * Indicate the items with a {@link Style}. For example - * {@code didNotFind("bean", "beans").items(Style.QUOTE, Collections.singleton("x")} results in - * the message "did not find bean 'x'". + * {@code didNotFind("bean", "beans").items(Style.QUOTE, Collections.singleton("x")} + * results in the message "did not find bean 'x'". * @param style the render style * @param items the source of the items (may be {@code null}) * @return a built {@link ConditionMessage} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java index ffb5d2977f..2b602ebf79 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java @@ -24,8 +24,8 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapt import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; /** - * A {@code RepositoryRestConfigurer} that applies configuration items from - * the {@code spring.data.rest} namespace to Spring Data REST. Also, if a + * A {@code RepositoryRestConfigurer} that applies configuration items from the + * {@code spring.data.rest} namespace to Spring Data REST. Also, if a * {@link Jackson2ObjectMapperBuilder} is available, it is used to configure Spring Data * REST's {@link ObjectMapper ObjectMappers}. * diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java index 166ce81275..bb0ca4cef1 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java @@ -16,8 +16,7 @@ package org.springframework.boot.autoconfigure.elasticsearch.jest; -import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -34,8 +33,7 @@ public class JestProperties { /** * Comma-separated list of the Elasticsearch instances to use. */ - private List uris = new ArrayList(Collections.singletonList( - "http://localhost:9200")); + private List uris = Arrays.asList("http://localhost:9200"); /** * Login user. diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java index 6e5d0ddc23..26690bb492 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java @@ -108,7 +108,8 @@ public class ProjectInfoAutoConfiguration { ConditionMessage.Builder message = ConditionMessage .forCondition("GitResource"); if (loader.getResource(location).exists()) { - return ConditionOutcome.match(message.found("git info at").items(location)); + return ConditionOutcome + .match(message.found("git info at").items(location)); } return ConditionOutcome .noMatch(message.didNotFind("git info at").items(location)); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java index c93014cac7..f3d1217b59 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java @@ -232,8 +232,8 @@ public class DataSourceAutoConfiguration { } if (anyMatches(context, metadata, this.pooledCondition, this.embeddedCondition)) { - return ConditionOutcome - .match(message.foundExactly("existing auto-configured data source bean")); + return ConditionOutcome.match(message + .foundExactly("existing auto-configured data source bean")); } return ConditionOutcome .noMatch(message.didNotFind("any existing data source bean").atAll()); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java index 14c829e954..b8a657b52f 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java @@ -205,8 +205,8 @@ public class MongoProperties { try { if (hasCustomAddress() || hasCustomCredentials()) { if (this.uri != null) { - throw new IllegalStateException("Invalid mongo configuration, " + - "either uri or host/port/credentials must be specified"); + throw new IllegalStateException("Invalid mongo configuration, " + + "either uri or host/port/credentials must be specified"); } if (options == null) { options = MongoClientOptions.builder().build(); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java index bfb70ef349..523906ab2a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java @@ -132,8 +132,8 @@ public class OAuth2ResourceServerConfiguration { if (ClassUtils.isPresent(AUTHORIZATION_ANNOTATION, null)) { if (AuthorizationServerEndpointsConfigurationBeanCondition .matches(context)) { - return ConditionOutcome - .match(message.found("class").items(AUTHORIZATION_ANNOTATION)); + return ConditionOutcome.match( + message.found("class").items(AUTHORIZATION_ANNOTATION)); } } return ConditionOutcome.noMatch( diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java index 6ecefb5d70..f86ff340de 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionCondition.java @@ -58,8 +58,8 @@ class SessionCondition extends SpringBootCondition { return ConditionOutcome.match(message .found("spring.session.store-type property").items(sessionStoreType)); } - return ConditionOutcome - .noMatch(message.found("spring.session.store-type property").items(value)); + return ConditionOutcome.noMatch( + message.found("spring.session.store-type property").items(value)); } } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java index 41e7ec5d43..04ab0800d8 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/OnEnabledResourceChainCondition.java @@ -50,8 +50,7 @@ class OnEnabledResourceChainCondition extends SpringBootCondition { ConditionMessage.Builder message = ConditionMessage .forCondition(ConditionalOnEnabledResourceChain.class); if (match == null) { - if (ClassUtils.isPresent(WEBJAR_ASSET_LOCATOR, - getClass().getClassLoader())) { + if (ClassUtils.isPresent(WEBJAR_ASSET_LOCATOR, getClass().getClassLoader())) { return ConditionOutcome .match(message.found("class").items(WEBJAR_ASSET_LOCATOR)); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 8a91c0c0ec..3647b6a1f9 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -92,8 +92,9 @@ public class BatchAutoConfigurationTests { this.context.refresh(); assertThat(this.context.getBean(JobLauncher.class)).isNotNull(); assertThat(this.context.getBean(JobExplorer.class)).isNotNull(); - assertThat(this.context.getBean(BatchProperties.class) - .getInitializer().isEnabled()).isTrue(); + assertThat( + this.context.getBean(BatchProperties.class).getInitializer().isEnabled()) + .isTrue(); assertThat(new JdbcTemplate(this.context.getBean(DataSource.class)) .queryForList("select * from BATCH_JOB_EXECUTION")).isEmpty(); } @@ -193,8 +194,9 @@ public class BatchAutoConfigurationTests { PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(JobLauncher.class)).isNotNull(); - assertThat(this.context.getBean(BatchProperties.class) - .getInitializer().isEnabled()).isFalse(); + assertThat( + this.context.getBean(BatchProperties.class).getInitializer().isEnabled()) + .isFalse(); this.expected.expect(BadSqlGrammarException.class); new JdbcTemplate(this.context.getBean(DataSource.class)) .queryForList("select * from BATCH_JOB_EXECUTION"); @@ -233,8 +235,9 @@ public class BatchAutoConfigurationTests { PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(JobLauncher.class)).isNotNull(); - assertThat(this.context.getBean(BatchProperties.class) - .getInitializer().isEnabled()).isTrue(); + assertThat( + this.context.getBean(BatchProperties.class).getInitializer().isEnabled()) + .isTrue(); assertThat(new JdbcTemplate(this.context.getBean(DataSource.class)) .queryForList("select * from PREFIX_JOB_EXECUTION")).isEmpty(); JobExplorer jobExplorer = this.context.getBean(JobExplorer.class); @@ -245,19 +248,20 @@ public class BatchAutoConfigurationTests { } @Test - public void testCustomTablePrefixWithDefaultSchemaDisablesInitializer() throws Exception { + public void testCustomTablePrefixWithDefaultSchemaDisablesInitializer() + throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, - "spring.datasource.name:batchtest", - "spring.batch.tablePrefix:PREFIX_"); + "spring.datasource.name:batchtest", "spring.batch.tablePrefix:PREFIX_"); this.context.register(TestConfiguration.class, EmbeddedDataSourceConfiguration.class, HibernateJpaAutoConfiguration.class, BatchAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); assertThat(this.context.getBean(JobLauncher.class)).isNotNull(); - assertThat(this.context.getBean(BatchProperties.class) - .getInitializer().isEnabled()).isFalse(); + assertThat( + this.context.getBean(BatchProperties.class).getInitializer().isEnabled()) + .isFalse(); this.expected.expect(BadSqlGrammarException.class); new JdbcTemplate(this.context.getBean(DataSource.class)) .queryForList("select * from BATCH_JOB_EXECUTION"); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index f07847bbd1..c5932505bb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -107,8 +107,8 @@ public class IntegrationAutoConfigurationTests { public void primaryExporterIsAllowed() { load(CustomMBeanExporter.class); assertThat(this.context.getBeansOfType(MBeanExporter.class)).hasSize(2); - assertThat(this.context.getBean(MBeanExporter.class)).isSameAs( - this.context.getBean("myMBeanExporter")); + assertThat(this.context.getBean(MBeanExporter.class)) + .isSameAs(this.context.getBean("myMBeanExporter")); } private static void assertDomains(MBeanServer mBeanServer, boolean expected, diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java index 5a89fbb378..cd79c5e3b0 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java @@ -134,8 +134,8 @@ public class MongoPropertiesTests { properties.setUsername("user"); properties.setPassword("secret".toCharArray()); this.thrown.expect(IllegalStateException.class); - this.thrown.expectMessage("Invalid mongo configuration, " + - "either uri or host/port/credentials must be specified"); + this.thrown.expectMessage("Invalid mongo configuration, " + + "either uri or host/port/credentials must be specified"); properties.createMongoClient(null, null); } @@ -146,8 +146,8 @@ public class MongoPropertiesTests { properties.setHost("localhost"); properties.setPort(4567); this.thrown.expect(IllegalStateException.class); - this.thrown.expectMessage("Invalid mongo configuration, " + - "either uri or host/port/credentials must be specified"); + this.thrown.expectMessage("Invalid mongo configuration, " + + "either uri or host/port/credentials must be specified"); properties.createMongoClient(null, null); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java index 03745f35cd..82b1277544 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java @@ -54,8 +54,8 @@ public class SessionAutoConfigurationJdbcTests JdbcOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("tableName")) .isEqualTo("SPRING_SESSION"); - assertThat(this.context.getBean(SessionProperties.class) - .getJdbc().getInitializer().isEnabled()).isTrue(); + assertThat(this.context.getBean(SessionProperties.class).getJdbc() + .getInitializer().isEnabled()).isTrue(); assertThat(this.context.getBean(JdbcOperations.class) .queryForList("select * from SPRING_SESSION")).isEmpty(); } @@ -70,8 +70,8 @@ public class SessionAutoConfigurationJdbcTests JdbcOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("tableName")) .isEqualTo("SPRING_SESSION"); - assertThat(this.context.getBean(SessionProperties.class) - .getJdbc().getInitializer().isEnabled()).isFalse(); + assertThat(this.context.getBean(SessionProperties.class).getJdbc() + .getInitializer().isEnabled()).isFalse(); this.thrown.expect(BadSqlGrammarException.class); assertThat(this.context.getBean(JdbcOperations.class) .queryForList("select * from SPRING_SESSION")).isEmpty(); @@ -88,8 +88,8 @@ public class SessionAutoConfigurationJdbcTests JdbcOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("tableName")) .isEqualTo("FOO_BAR"); - assertThat(this.context.getBean(SessionProperties.class) - .getJdbc().getInitializer().isEnabled()).isTrue(); + assertThat(this.context.getBean(SessionProperties.class).getJdbc() + .getInitializer().isEnabled()).isTrue(); assertThat(this.context.getBean(JdbcOperations.class) .queryForList("select * from FOO_BAR")).isEmpty(); } @@ -104,8 +104,8 @@ public class SessionAutoConfigurationJdbcTests JdbcOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("tableName")) .isEqualTo("FOO_BAR"); - assertThat(this.context.getBean(SessionProperties.class) - .getJdbc().getInitializer().isEnabled()).isFalse(); + assertThat(this.context.getBean(SessionProperties.class).getJdbc() + .getInitializer().isEnabled()).isFalse(); this.thrown.expect(BadSqlGrammarException.class); assertThat(this.context.getBean(JdbcOperations.class) .queryForList("select * from SPRING_SESSION")).isEmpty(); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java index 29c1389f59..dd7b2d05e6 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java @@ -50,7 +50,8 @@ public class SessionAutoConfigurationRedisTests public void redisSessionStoreIsTheDefault() { load(Collections.>singletonList(RedisAutoConfiguration.class)); validateSpringSessionUsesRedis(); - this.output.expect(containsString("Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration")); + this.output.expect(containsString( + "Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration")); } @Test @@ -58,7 +59,8 @@ public class SessionAutoConfigurationRedisTests load(Collections.>singletonList(RedisAutoConfiguration.class), "spring.session.store-type=redis"); validateSpringSessionUsesRedis(); - this.output.expect(not(containsString("Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"))); + this.output.expect(not(containsString( + "Spring Session store type is mandatory: set 'spring.session.store-type=redis' in your configuration"))); } private void validateSpringSessionUsesRedis() { diff --git a/spring-boot-samples/pom.xml b/spring-boot-samples/pom.xml index f5a9255884..c9f0c79b64 100644 --- a/spring-boot-samples/pom.xml +++ b/spring-boot-samples/pom.xml @@ -81,6 +81,7 @@ spring-boot-sample-session-redis spring-boot-sample-simple spring-boot-sample-test + spring-boot-sample-test-nomockito spring-boot-sample-testng spring-boot-sample-tomcat spring-boot-sample-tomcat-jsp @@ -182,6 +183,25 @@ + + + + org.apache.maven.plugins + + + maven-enforcer-plugin + + + [1.3.1,) + + + enforce + + + + + + diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java index bad6cbd805..0052e031c3 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Author.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.sql.Date; import java.util.Arrays; import java.util.List; @@ -18,123 +17,123 @@ import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Author extends TableImpl { - private static final long serialVersionUID = 1187406915; - - /** - * The reference instance of PUBLIC.AUTHOR - */ - public static final Author AUTHOR = new Author(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return Record.class; - } - - /** - * The column PUBLIC.AUTHOR.ID. - */ - public final TableField ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.AUTHOR.FIRST_NAME. - */ - public final TableField FIRST_NAME = createField("FIRST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); - - /** - * The column PUBLIC.AUTHOR.LAST_NAME. - */ - public final TableField LAST_NAME = createField("LAST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, ""); - - /** - * The column PUBLIC.AUTHOR.DATE_OF_BIRTH. - */ - public final TableField DATE_OF_BIRTH = createField("DATE_OF_BIRTH", org.jooq.impl.SQLDataType.DATE, this, ""); - - /** - * The column PUBLIC.AUTHOR.YEAR_OF_BIRTH. - */ - public final TableField YEAR_OF_BIRTH = createField("YEAR_OF_BIRTH", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * The column PUBLIC.AUTHOR.DISTINGUISHED. - */ - public final TableField DISTINGUISHED = createField("DISTINGUISHED", org.jooq.impl.SQLDataType.TINYINT, this, ""); - - /** - * Create a PUBLIC.AUTHOR table reference - */ - public Author() { - this("AUTHOR", null); - } - - /** - * Create an aliased PUBLIC.AUTHOR table reference - */ - public Author(String alias) { - this(alias, AUTHOR); - } - - private Author(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Author(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Public.PUBLIC; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.CONSTRAINT_7; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_7); - } - - /** - * {@inheritDoc} - */ - @Override - public Author as(String alias) { - return new Author(alias, this); - } - - /** - * Rename this table - */ - public Author rename(String name) { - return new Author(name, null); - } + private static final long serialVersionUID = 1187406915; + + /** + * The reference instance of PUBLIC.AUTHOR + */ + public static final Author AUTHOR = new Author(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return Record.class; + } + + /** + * The column PUBLIC.AUTHOR.ID. + */ + public final TableField ID = createField("ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.AUTHOR.FIRST_NAME. + */ + public final TableField FIRST_NAME = createField("FIRST_NAME", + org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); + + /** + * The column PUBLIC.AUTHOR.LAST_NAME. + */ + public final TableField LAST_NAME = createField("LAST_NAME", + org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, ""); + + /** + * The column PUBLIC.AUTHOR.DATE_OF_BIRTH. + */ + public final TableField DATE_OF_BIRTH = createField("DATE_OF_BIRTH", + org.jooq.impl.SQLDataType.DATE, this, ""); + + /** + * The column PUBLIC.AUTHOR.YEAR_OF_BIRTH. + */ + public final TableField YEAR_OF_BIRTH = createField("YEAR_OF_BIRTH", + org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column PUBLIC.AUTHOR.DISTINGUISHED. + */ + public final TableField DISTINGUISHED = createField("DISTINGUISHED", + org.jooq.impl.SQLDataType.TINYINT, this, ""); + + /** + * Create a PUBLIC.AUTHOR table reference + */ + public Author() { + this("AUTHOR", null); + } + + /** + * Create an aliased PUBLIC.AUTHOR table reference + */ + public Author(String alias) { + this(alias, AUTHOR); + } + + private Author(String alias, Table aliased) { + this(alias, aliased, null); + } + + private Author(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONSTRAINT_7; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CONSTRAINT_7); + } + + /** + * {@inheritDoc} + */ + @Override + public Author as(String alias) { + return new Author(alias, this); + } + + /** + * Rename this table + */ + public Author rename(String name) { + return new Author(name, null); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java index c1956abc04..b987e2f5b6 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Book.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.Arrays; import java.util.List; @@ -18,126 +17,126 @@ import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Book extends TableImpl { - private static final long serialVersionUID = 1176189796; - - /** - * The reference instance of PUBLIC.BOOK - */ - public static final Book BOOK = new Book(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return Record.class; - } - - /** - * The column PUBLIC.BOOK.ID. - */ - public final TableField ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK.AUTHOR_ID. - */ - public final TableField AUTHOR_ID = createField("AUTHOR_ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK.TITLE. - */ - public final TableField TITLE = createField("TITLE", org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK.PUBLISHED_IN. - */ - public final TableField PUBLISHED_IN = createField("PUBLISHED_IN", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK.LANGUAGE_ID. - */ - public final TableField LANGUAGE_ID = createField("LANGUAGE_ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a PUBLIC.BOOK table reference - */ - public Book() { - this("BOOK", null); - } - - /** - * Create an aliased PUBLIC.BOOK table reference - */ - public Book(String alias) { - this(alias, BOOK); - } - - private Book(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Book(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Public.PUBLIC; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.CONSTRAINT_1; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_1); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FK_BOOK_AUTHOR, Keys.FK_BOOK_LANGUAGE); - } - - /** - * {@inheritDoc} - */ - @Override - public Book as(String alias) { - return new Book(alias, this); - } - - /** - * Rename this table - */ - public Book rename(String name) { - return new Book(name, null); - } + private static final long serialVersionUID = 1176189796; + + /** + * The reference instance of PUBLIC.BOOK + */ + public static final Book BOOK = new Book(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return Record.class; + } + + /** + * The column PUBLIC.BOOK.ID. + */ + public final TableField ID = createField("ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK.AUTHOR_ID. + */ + public final TableField AUTHOR_ID = createField("AUTHOR_ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK.TITLE. + */ + public final TableField TITLE = createField("TITLE", + org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK.PUBLISHED_IN. + */ + public final TableField PUBLISHED_IN = createField("PUBLISHED_IN", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK.LANGUAGE_ID. + */ + public final TableField LANGUAGE_ID = createField("LANGUAGE_ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a PUBLIC.BOOK table reference + */ + public Book() { + this("BOOK", null); + } + + /** + * Create an aliased PUBLIC.BOOK table reference + */ + public Book(String alias) { + this(alias, BOOK); + } + + private Book(String alias, Table aliased) { + this(alias, aliased, null); + } + + private Book(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONSTRAINT_1; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CONSTRAINT_1); + } + + /** + * {@inheritDoc} + */ + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FK_BOOK_AUTHOR, + Keys.FK_BOOK_LANGUAGE); + } + + /** + * {@inheritDoc} + */ + @Override + public Book as(String alias) { + return new Book(alias, this); + } + + /** + * Rename this table + */ + public Book rename(String name) { + return new Book(name, null); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java index 2a9ec44f91..a4025863c5 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookStore.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.Arrays; import java.util.List; @@ -17,90 +16,85 @@ import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class BookStore extends TableImpl { - private static final long serialVersionUID = -2132596210; - - /** - * The reference instance of PUBLIC.BOOK_STORE - */ - public static final BookStore BOOK_STORE = new BookStore(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return Record.class; - } - - /** - * The column PUBLIC.BOOK_STORE.NAME. - */ - public final TableField NAME = createField("NAME", org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); - - /** - * Create a PUBLIC.BOOK_STORE table reference - */ - public BookStore() { - this("BOOK_STORE", null); - } - - /** - * Create an aliased PUBLIC.BOOK_STORE table reference - */ - public BookStore(String alias) { - this(alias, BOOK_STORE); - } - - private BookStore(String alias, Table aliased) { - this(alias, aliased, null); - } - - private BookStore(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Public.PUBLIC; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_F); - } - - /** - * {@inheritDoc} - */ - @Override - public BookStore as(String alias) { - return new BookStore(alias, this); - } - - /** - * Rename this table - */ - public BookStore rename(String name) { - return new BookStore(name, null); - } + private static final long serialVersionUID = -2132596210; + + /** + * The reference instance of PUBLIC.BOOK_STORE + */ + public static final BookStore BOOK_STORE = new BookStore(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return Record.class; + } + + /** + * The column PUBLIC.BOOK_STORE.NAME. + */ + public final TableField NAME = createField("NAME", + org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); + + /** + * Create a PUBLIC.BOOK_STORE table reference + */ + public BookStore() { + this("BOOK_STORE", null); + } + + /** + * Create an aliased PUBLIC.BOOK_STORE table reference + */ + public BookStore(String alias) { + this(alias, BOOK_STORE); + } + + private BookStore(String alias, Table aliased) { + this(alias, aliased, null); + } + + private BookStore(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CONSTRAINT_F); + } + + /** + * {@inheritDoc} + */ + @Override + public BookStore as(String alias) { + return new BookStore(alias, this); + } + + /** + * Rename this table + */ + public BookStore rename(String name) { + return new BookStore(name, null); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java index 14d7670efa..fa5ea67190 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/BookToBookStore.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.Arrays; import java.util.List; @@ -18,116 +17,114 @@ import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class BookToBookStore extends TableImpl { - private static final long serialVersionUID = -1360744633; - - /** - * The reference instance of PUBLIC.BOOK_TO_BOOK_STORE - */ - public static final BookToBookStore BOOK_TO_BOOK_STORE = new BookToBookStore(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return Record.class; - } - - /** - * The column PUBLIC.BOOK_TO_BOOK_STORE.NAME. - */ - public final TableField NAME = createField("NAME", org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK_TO_BOOK_STORE.BOOK_ID. - */ - public final TableField BOOK_ID = createField("BOOK_ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.BOOK_TO_BOOK_STORE.STOCK. - */ - public final TableField STOCK = createField("STOCK", org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * Create a PUBLIC.BOOK_TO_BOOK_STORE table reference - */ - public BookToBookStore() { - this("BOOK_TO_BOOK_STORE", null); - } - - /** - * Create an aliased PUBLIC.BOOK_TO_BOOK_STORE table reference - */ - public BookToBookStore(String alias) { - this(alias, BOOK_TO_BOOK_STORE); - } - - private BookToBookStore(String alias, Table aliased) { - this(alias, aliased, null); - } - - private BookToBookStore(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Public.PUBLIC; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.CONSTRAINT_2; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_2); - } - - /** - * {@inheritDoc} - */ - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FK_B2BS_BOOK_STORE, Keys.FK_B2BS_BOOK); - } - - /** - * {@inheritDoc} - */ - @Override - public BookToBookStore as(String alias) { - return new BookToBookStore(alias, this); - } - - /** - * Rename this table - */ - public BookToBookStore rename(String name) { - return new BookToBookStore(name, null); - } + private static final long serialVersionUID = -1360744633; + + /** + * The reference instance of PUBLIC.BOOK_TO_BOOK_STORE + */ + public static final BookToBookStore BOOK_TO_BOOK_STORE = new BookToBookStore(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return Record.class; + } + + /** + * The column PUBLIC.BOOK_TO_BOOK_STORE.NAME. + */ + public final TableField NAME = createField("NAME", + org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK_TO_BOOK_STORE.BOOK_ID. + */ + public final TableField BOOK_ID = createField("BOOK_ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.BOOK_TO_BOOK_STORE.STOCK. + */ + public final TableField STOCK = createField("STOCK", + org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * Create a PUBLIC.BOOK_TO_BOOK_STORE table reference + */ + public BookToBookStore() { + this("BOOK_TO_BOOK_STORE", null); + } + + /** + * Create an aliased PUBLIC.BOOK_TO_BOOK_STORE table reference + */ + public BookToBookStore(String alias) { + this(alias, BOOK_TO_BOOK_STORE); + } + + private BookToBookStore(String alias, Table aliased) { + this(alias, aliased, null); + } + + private BookToBookStore(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONSTRAINT_2; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CONSTRAINT_2); + } + + /** + * {@inheritDoc} + */ + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FK_B2BS_BOOK_STORE, + Keys.FK_B2BS_BOOK); + } + + /** + * {@inheritDoc} + */ + @Override + public BookToBookStore as(String alias) { + return new BookToBookStore(alias, this); + } + + /** + * Rename this table + */ + public BookToBookStore rename(String name) { + return new BookToBookStore(name, null); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java index ad694671be..8d7d9f5aba 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/DefaultCatalog.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -13,48 +12,41 @@ import javax.annotation.Generated; import org.jooq.Schema; import org.jooq.impl.CatalogImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { - private static final long serialVersionUID = -1557925562; - - /** - * The reference instance of - */ - public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); - - /** - * The schema PUBLIC. - */ - public final Public PUBLIC = sample.jooq.domain.Public.PUBLIC; - - /** - * No further instances allowed - */ - private DefaultCatalog() { - super(""); - } - - @Override - public final List getSchemas() { - List result = new ArrayList(); - result.addAll(getSchemas0()); - return result; - } - - private final List getSchemas0() { - return Arrays.asList( - Public.PUBLIC); - } + private static final long serialVersionUID = -1557925562; + + /** + * The reference instance of + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema PUBLIC. + */ + public final Public PUBLIC = sample.jooq.domain.Public.PUBLIC; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + List result = new ArrayList(); + result.addAll(getSchemas0()); + return result; + } + + private final List getSchemas0() { + return Arrays.asList(Public.PUBLIC); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Keys.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Keys.java index 40c31d9b1b..c31be48346 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Keys.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Keys.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import javax.annotation.Generated; import org.jooq.ForeignKey; @@ -11,61 +10,69 @@ import org.jooq.Record; import org.jooq.UniqueKey; import org.jooq.impl.AbstractKeys; - /** - * A class modelling foreign key relationships between tables of the PUBLIC + * A class modelling foreign key relationships between tables of the PUBLIC * schema */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { - // ------------------------------------------------------------------------- - // IDENTITY definitions - // ------------------------------------------------------------------------- - + // ------------------------------------------------------------------------- + // IDENTITY definitions + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // UNIQUE and PRIMARY KEY definitions - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- - public static final UniqueKey CONSTRAINT_C = UniqueKeys0.CONSTRAINT_C; - public static final UniqueKey CONSTRAINT_7 = UniqueKeys0.CONSTRAINT_7; - public static final UniqueKey CONSTRAINT_1 = UniqueKeys0.CONSTRAINT_1; - public static final UniqueKey CONSTRAINT_F = UniqueKeys0.CONSTRAINT_F; - public static final UniqueKey CONSTRAINT_2 = UniqueKeys0.CONSTRAINT_2; + public static final UniqueKey CONSTRAINT_C = UniqueKeys0.CONSTRAINT_C; + public static final UniqueKey CONSTRAINT_7 = UniqueKeys0.CONSTRAINT_7; + public static final UniqueKey CONSTRAINT_1 = UniqueKeys0.CONSTRAINT_1; + public static final UniqueKey CONSTRAINT_F = UniqueKeys0.CONSTRAINT_F; + public static final UniqueKey CONSTRAINT_2 = UniqueKeys0.CONSTRAINT_2; - // ------------------------------------------------------------------------- - // FOREIGN KEY definitions - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- - public static final ForeignKey FK_BOOK_AUTHOR = ForeignKeys0.FK_BOOK_AUTHOR; - public static final ForeignKey FK_BOOK_LANGUAGE = ForeignKeys0.FK_BOOK_LANGUAGE; - public static final ForeignKey FK_B2BS_BOOK_STORE = ForeignKeys0.FK_B2BS_BOOK_STORE; - public static final ForeignKey FK_B2BS_BOOK = ForeignKeys0.FK_B2BS_BOOK; + public static final ForeignKey FK_BOOK_AUTHOR = ForeignKeys0.FK_BOOK_AUTHOR; + public static final ForeignKey FK_BOOK_LANGUAGE = ForeignKeys0.FK_BOOK_LANGUAGE; + public static final ForeignKey FK_B2BS_BOOK_STORE = ForeignKeys0.FK_B2BS_BOOK_STORE; + public static final ForeignKey FK_B2BS_BOOK = ForeignKeys0.FK_B2BS_BOOK; - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- - private static class UniqueKeys0 extends AbstractKeys { - public static final UniqueKey CONSTRAINT_C = createUniqueKey(Language.LANGUAGE, "CONSTRAINT_C", Language.LANGUAGE.ID); - public static final UniqueKey CONSTRAINT_7 = createUniqueKey(Author.AUTHOR, "CONSTRAINT_7", Author.AUTHOR.ID); - public static final UniqueKey CONSTRAINT_1 = createUniqueKey(Book.BOOK, "CONSTRAINT_1", Book.BOOK.ID); - public static final UniqueKey CONSTRAINT_F = createUniqueKey(BookStore.BOOK_STORE, "CONSTRAINT_F", BookStore.BOOK_STORE.NAME); - public static final UniqueKey CONSTRAINT_2 = createUniqueKey(BookToBookStore.BOOK_TO_BOOK_STORE, "CONSTRAINT_2", BookToBookStore.BOOK_TO_BOOK_STORE.NAME, BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); - } + private static class UniqueKeys0 extends AbstractKeys { + public static final UniqueKey CONSTRAINT_C = createUniqueKey( + Language.LANGUAGE, "CONSTRAINT_C", Language.LANGUAGE.ID); + public static final UniqueKey CONSTRAINT_7 = createUniqueKey( + Author.AUTHOR, "CONSTRAINT_7", Author.AUTHOR.ID); + public static final UniqueKey CONSTRAINT_1 = createUniqueKey(Book.BOOK, + "CONSTRAINT_1", Book.BOOK.ID); + public static final UniqueKey CONSTRAINT_F = createUniqueKey( + BookStore.BOOK_STORE, "CONSTRAINT_F", BookStore.BOOK_STORE.NAME); + public static final UniqueKey CONSTRAINT_2 = createUniqueKey( + BookToBookStore.BOOK_TO_BOOK_STORE, "CONSTRAINT_2", + BookToBookStore.BOOK_TO_BOOK_STORE.NAME, + BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); + } - private static class ForeignKeys0 extends AbstractKeys { - public static final ForeignKey FK_BOOK_AUTHOR = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_7, Book.BOOK, "FK_BOOK_AUTHOR", Book.BOOK.AUTHOR_ID); - public static final ForeignKey FK_BOOK_LANGUAGE = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_C, Book.BOOK, "FK_BOOK_LANGUAGE", Book.BOOK.LANGUAGE_ID); - public static final ForeignKey FK_B2BS_BOOK_STORE = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_F, BookToBookStore.BOOK_TO_BOOK_STORE, "FK_B2BS_BOOK_STORE", BookToBookStore.BOOK_TO_BOOK_STORE.NAME); - public static final ForeignKey FK_B2BS_BOOK = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_1, BookToBookStore.BOOK_TO_BOOK_STORE, "FK_B2BS_BOOK", BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); - } + private static class ForeignKeys0 extends AbstractKeys { + public static final ForeignKey FK_BOOK_AUTHOR = createForeignKey( + sample.jooq.domain.Keys.CONSTRAINT_7, Book.BOOK, "FK_BOOK_AUTHOR", + Book.BOOK.AUTHOR_ID); + public static final ForeignKey FK_BOOK_LANGUAGE = createForeignKey( + sample.jooq.domain.Keys.CONSTRAINT_C, Book.BOOK, "FK_BOOK_LANGUAGE", + Book.BOOK.LANGUAGE_ID); + public static final ForeignKey FK_B2BS_BOOK_STORE = createForeignKey( + sample.jooq.domain.Keys.CONSTRAINT_F, BookToBookStore.BOOK_TO_BOOK_STORE, + "FK_B2BS_BOOK_STORE", BookToBookStore.BOOK_TO_BOOK_STORE.NAME); + public static final ForeignKey FK_B2BS_BOOK = createForeignKey( + sample.jooq.domain.Keys.CONSTRAINT_1, BookToBookStore.BOOK_TO_BOOK_STORE, + "FK_B2BS_BOOK", BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java index d428bab66e..a8f9d51578 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Language.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.Arrays; import java.util.List; @@ -17,108 +16,105 @@ import org.jooq.TableField; import org.jooq.UniqueKey; import org.jooq.impl.TableImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Language extends TableImpl { - private static final long serialVersionUID = -1890716744; - - /** - * The reference instance of PUBLIC.LANGUAGE - */ - public static final Language LANGUAGE = new Language(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return Record.class; - } - - /** - * The column PUBLIC.LANGUAGE.ID. - */ - public final TableField ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column PUBLIC.LANGUAGE.CD. - */ - public final TableField CD = createField("CD", org.jooq.impl.SQLDataType.CHAR.length(2).nullable(false), this, ""); - - /** - * The column PUBLIC.LANGUAGE.DESCRIPTION. - */ - public final TableField DESCRIPTION = createField("DESCRIPTION", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); - - /** - * Create a PUBLIC.LANGUAGE table reference - */ - public Language() { - this("LANGUAGE", null); - } - - /** - * Create an aliased PUBLIC.LANGUAGE table reference - */ - public Language(String alias) { - this(alias, LANGUAGE); - } - - private Language(String alias, Table aliased) { - this(alias, aliased, null); - } - - private Language(String alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, ""); - } - - /** - * {@inheritDoc} - */ - @Override - public Schema getSchema() { - return Public.PUBLIC; - } - - /** - * {@inheritDoc} - */ - @Override - public UniqueKey getPrimaryKey() { - return Keys.CONSTRAINT_C; - } - - /** - * {@inheritDoc} - */ - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CONSTRAINT_C); - } - - /** - * {@inheritDoc} - */ - @Override - public Language as(String alias) { - return new Language(alias, this); - } - - /** - * Rename this table - */ - public Language rename(String name) { - return new Language(name, null); - } + private static final long serialVersionUID = -1890716744; + + /** + * The reference instance of PUBLIC.LANGUAGE + */ + public static final Language LANGUAGE = new Language(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return Record.class; + } + + /** + * The column PUBLIC.LANGUAGE.ID. + */ + public final TableField ID = createField("ID", + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column PUBLIC.LANGUAGE.CD. + */ + public final TableField CD = createField("CD", + org.jooq.impl.SQLDataType.CHAR.length(2).nullable(false), this, ""); + + /** + * The column PUBLIC.LANGUAGE.DESCRIPTION. + */ + public final TableField DESCRIPTION = createField("DESCRIPTION", + org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); + + /** + * Create a PUBLIC.LANGUAGE table reference + */ + public Language() { + this("LANGUAGE", null); + } + + /** + * Create an aliased PUBLIC.LANGUAGE table reference + */ + public Language(String alias) { + this(alias, LANGUAGE); + } + + private Language(String alias, Table aliased) { + this(alias, aliased, null); + } + + private Language(String alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, ""); + } + + /** + * {@inheritDoc} + */ + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + /** + * {@inheritDoc} + */ + @Override + public UniqueKey getPrimaryKey() { + return Keys.CONSTRAINT_C; + } + + /** + * {@inheritDoc} + */ + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CONSTRAINT_C); + } + + /** + * {@inheritDoc} + */ + @Override + public Language as(String alias) { + return new Language(alias, this); + } + + /** + * Rename this table + */ + public Language rename(String name) { + return new Language(name, null); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java index 2a62940b2c..518929650f 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java @@ -3,7 +3,6 @@ */ package sample.jooq.domain; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -14,81 +13,70 @@ import org.jooq.Catalog; import org.jooq.Table; import org.jooq.impl.SchemaImpl; - /** * This class is generated by jOOQ. */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Public extends SchemaImpl { - private static final long serialVersionUID = 217498103; - - /** - * The reference instance of PUBLIC - */ - public static final Public PUBLIC = new Public(); - - /** - * The table PUBLIC.LANGUAGE. - */ - public final Language LANGUAGE = sample.jooq.domain.Language.LANGUAGE; - - /** - * The table PUBLIC.AUTHOR. - */ - public final Author AUTHOR = sample.jooq.domain.Author.AUTHOR; - - /** - * The table PUBLIC.BOOK. - */ - public final Book BOOK = sample.jooq.domain.Book.BOOK; - - /** - * The table PUBLIC.BOOK_STORE. - */ - public final BookStore BOOK_STORE = sample.jooq.domain.BookStore.BOOK_STORE; - - /** - * The table PUBLIC.BOOK_TO_BOOK_STORE. - */ - public final BookToBookStore BOOK_TO_BOOK_STORE = sample.jooq.domain.BookToBookStore.BOOK_TO_BOOK_STORE; - - /** - * No further instances allowed - */ - private Public() { - super("PUBLIC", null); - } - - - /** - * {@inheritDoc} - */ - @Override - public Catalog getCatalog() { - return DefaultCatalog.DEFAULT_CATALOG; - } - - @Override - public final List> getTables() { - List result = new ArrayList(); - result.addAll(getTables0()); - return result; - } - - private final List> getTables0() { - return Arrays.>asList( - Language.LANGUAGE, - Author.AUTHOR, - Book.BOOK, - BookStore.BOOK_STORE, - BookToBookStore.BOOK_TO_BOOK_STORE); - } + private static final long serialVersionUID = 217498103; + + /** + * The reference instance of PUBLIC + */ + public static final Public PUBLIC = new Public(); + + /** + * The table PUBLIC.LANGUAGE. + */ + public final Language LANGUAGE = sample.jooq.domain.Language.LANGUAGE; + + /** + * The table PUBLIC.AUTHOR. + */ + public final Author AUTHOR = sample.jooq.domain.Author.AUTHOR; + + /** + * The table PUBLIC.BOOK. + */ + public final Book BOOK = sample.jooq.domain.Book.BOOK; + + /** + * The table PUBLIC.BOOK_STORE. + */ + public final BookStore BOOK_STORE = sample.jooq.domain.BookStore.BOOK_STORE; + + /** + * The table PUBLIC.BOOK_TO_BOOK_STORE. + */ + public final BookToBookStore BOOK_TO_BOOK_STORE = sample.jooq.domain.BookToBookStore.BOOK_TO_BOOK_STORE; + + /** + * No further instances allowed + */ + private Public() { + super("PUBLIC", null); + } + + /** + * {@inheritDoc} + */ + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList(Language.LANGUAGE, Author.AUTHOR, Book.BOOK, + BookStore.BOOK_STORE, BookToBookStore.BOOK_TO_BOOK_STORE); + } } diff --git a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Tables.java b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Tables.java index cda1ec3a6f..b31f88e74f 100644 --- a/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Tables.java +++ b/spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Tables.java @@ -3,45 +3,38 @@ */ package sample.jooq.domain; - import javax.annotation.Generated; - /** * Convenience access to all tables in PUBLIC */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.8.2" - }, - comments = "This class is generated by jOOQ" -) +@Generated(value = { "http://www.jooq.org", + "jOOQ version:3.8.2" }, comments = "This class is generated by jOOQ") @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { - /** - * The table PUBLIC.LANGUAGE. - */ - public static final Language LANGUAGE = sample.jooq.domain.Language.LANGUAGE; - - /** - * The table PUBLIC.AUTHOR. - */ - public static final Author AUTHOR = sample.jooq.domain.Author.AUTHOR; - - /** - * The table PUBLIC.BOOK. - */ - public static final Book BOOK = sample.jooq.domain.Book.BOOK; - - /** - * The table PUBLIC.BOOK_STORE. - */ - public static final BookStore BOOK_STORE = sample.jooq.domain.BookStore.BOOK_STORE; - - /** - * The table PUBLIC.BOOK_TO_BOOK_STORE. - */ - public static final BookToBookStore BOOK_TO_BOOK_STORE = sample.jooq.domain.BookToBookStore.BOOK_TO_BOOK_STORE; + /** + * The table PUBLIC.LANGUAGE. + */ + public static final Language LANGUAGE = sample.jooq.domain.Language.LANGUAGE; + + /** + * The table PUBLIC.AUTHOR. + */ + public static final Author AUTHOR = sample.jooq.domain.Author.AUTHOR; + + /** + * The table PUBLIC.BOOK. + */ + public static final Book BOOK = sample.jooq.domain.Book.BOOK; + + /** + * The table PUBLIC.BOOK_STORE. + */ + public static final BookStore BOOK_STORE = sample.jooq.domain.BookStore.BOOK_STORE; + + /** + * The table PUBLIC.BOOK_TO_BOOK_STORE. + */ + public static final BookToBookStore BOOK_TO_BOOK_STORE = sample.jooq.domain.BookToBookStore.BOOK_TO_BOOK_STORE; } diff --git a/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java b/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java index a5b6c50081..cdb339f609 100644 --- a/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java @@ -43,8 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Dave Syer */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = { SampleSecureApplication.class, - TestConfiguration.class }) +@SpringBootTest(classes = { SampleSecureApplication.class, TestConfiguration.class }) public class SampleSecureApplicationTests { @Autowired diff --git a/spring-boot-samples/spring-boot-sample-test-nomockito/pom.xml b/spring-boot-samples/spring-boot-sample-test-nomockito/pom.xml new file mode 100644 index 0000000000..289e01c32b --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-test-nomockito/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-samples + 1.4.2.BUILD-SNAPSHOT + + spring-boot-sample-test-nomockito + Spring Boot Test Sample No Mockito + Spring Boot Test Sample No Mockito + http://projects.spring.io/spring-boot/ + + Pivotal Software, Inc. + http://www.spring.io + + + ${basedir}/../.. + + + + org.springframework.boot + spring-boot-starter + + + junit + junit + test + + + org.springframework.boot + spring-boot-test + test + + + org.springframework + spring-test + test + + + org.assertj + assertj-core + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/spring-boot-samples/spring-boot-sample-test-nomockito/src/main/java/sample/testnomockito/SampleTestNoMockitoApplication.java b/spring-boot-samples/spring-boot-sample-test-nomockito/src/main/java/sample/testnomockito/SampleTestNoMockitoApplication.java new file mode 100644 index 0000000000..550aa84d6e --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-test-nomockito/src/main/java/sample/testnomockito/SampleTestNoMockitoApplication.java @@ -0,0 +1,13 @@ +package sample.testnomockito; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SampleTestNoMockitoApplication { + + public static void main(String[] args) { + SpringApplication.run(SampleTestNoMockitoApplication.class); + } + +} diff --git a/spring-boot-samples/spring-boot-sample-test-nomockito/src/test/java/sample/testnomockito/SampleTestNoMockitoApplicationTest.java b/spring-boot-samples/spring-boot-sample-test-nomockito/src/test/java/sample/testnomockito/SampleTestNoMockitoApplicationTest.java new file mode 100644 index 0000000000..589bb0c4f1 --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-test-nomockito/src/test/java/sample/testnomockito/SampleTestNoMockitoApplicationTest.java @@ -0,0 +1,32 @@ +package sample.testnomockito; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests that {code ResetMocksTestExecutionListener} and + * {@code MockitoTestExecutionListener} gracefully degrade when Mockito is not on the + * classpath. + * + * @author Madhura Bhave + */ +@RunWith(SpringRunner.class) +public class SampleTestNoMockitoApplicationTest { + + // gh-7065 + + @Autowired + private ApplicationContext context; + + @Test + public void contextLoads() throws Exception { + assertThat(this.context).isNotNull(); + } + +} diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java index f0042116d5..5cef1c2cc5 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java @@ -26,6 +26,7 @@ import org.mockito.listeners.MethodInvocationReport; import org.mockito.mock.MockCreationSettings; import org.springframework.util.Assert; +import org.springframework.util.ClassUtils; /** * Reset strategy used on a mock bean. Usually applied to a mock via the @@ -53,8 +54,6 @@ public enum MockReset { */ NONE; - private static final MockUtil util = new MockUtil(); - /** * Create {@link MockSettings settings} to be used with mocks where reset should occur * before each test method runs. @@ -105,12 +104,15 @@ public enum MockReset { @SuppressWarnings("rawtypes") static MockReset get(Object mock) { MockReset reset = MockReset.NONE; - if (util.isMock(mock)) { - MockCreationSettings settings = util.getMockSettings(mock); - List listeners = settings.getInvocationListeners(); - for (Object listener : listeners) { - if (listener instanceof ResetInvocationListener) { - reset = ((ResetInvocationListener) listener).getReset(); + if (ClassUtils.isPresent("org.mockito.internal.util.MockUtil", null)) { + MockUtil mockUtil = new MockUtil(); + if (mockUtil.isMock(mock)) { + MockCreationSettings settings = mockUtil.getMockSettings(mock); + List listeners = settings.getInvocationListeners(); + for (Object listener : listeners) { + if (listener instanceof ResetInvocationListener) { + reset = ((ResetInvocationListener) listener).getReset(); + } } } } diff --git a/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperExampleConfig.java b/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperExampleConfig.java index 15f99f1bda..d1daf1d6bf 100644 --- a/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperExampleConfig.java +++ b/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperExampleConfig.java @@ -19,7 +19,8 @@ package org.springframework.boot.test.context.bootstrap; import org.springframework.boot.SpringBootConfiguration; /** - * Example configuration used in {@link SpringBootTestContextBootstrapperIntegrationTests}. + * Example configuration used in + * {@link SpringBootTestContextBootstrapperIntegrationTests}. * * @author Phillip Webb */ diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidDoubleRegistrationProperties.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidDoubleRegistrationProperties.java index 1bca18686c..d8a9e33b94 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidDoubleRegistrationProperties.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/specific/InvalidDoubleRegistrationProperties.java @@ -19,8 +19,7 @@ package org.springframework.boot.configurationsample.specific; import org.springframework.boot.configurationsample.ConfigurationProperties; /** - * Test that compilation fails if the same type is registered twice with the - * same prefix. + * Test that compilation fails if the same type is registered twice with the same prefix. * * @author Stephane Nicoll */ diff --git a/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java b/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java index 867b9673b1..de26352fb6 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/event/EventPublishingRunListener.java @@ -28,9 +28,9 @@ import org.springframework.core.env.ConfigurableEnvironment; /** * {@link SpringApplicationRunListener} to publish {@link SpringApplicationEvent}s. - * - *

Uses an internal {@link ApplicationEventMulticaster} for the events that are - * fired before the context is actually refreshed. + *

+ * Uses an internal {@link ApplicationEventMulticaster} for the events that are fired + * before the context is actually refreshed. * * @author Phillip Webb * @author Stephane Nicoll @@ -59,8 +59,8 @@ public class EventPublishingRunListener implements SpringApplicationRunListener, @Override public void started() { - this.initialMulticaster.multicastEvent(new ApplicationStartedEvent( - this.application, this.args)); + this.initialMulticaster + .multicastEvent(new ApplicationStartedEvent(this.application, this.args)); } @Override @@ -82,8 +82,8 @@ public class EventPublishingRunListener implements SpringApplicationRunListener, } context.addApplicationListener(listener); } - this.initialMulticaster.multicastEvent(new ApplicationPreparedEvent( - this.application, this.args, context)); + this.initialMulticaster.multicastEvent( + new ApplicationPreparedEvent(this.application, this.args, context)); } @Override diff --git a/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java index 030995ffa3..3c29532da7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/env/EnvironmentPostProcessor.java @@ -23,15 +23,15 @@ import org.springframework.core.env.Environment; /** * Allows for customization of the application's {@link Environment} prior to the * application context being refreshed. - * - *

EnvironmentPostProcessor implementations have to be registered in - * {@code META-INF/spring.factories}, using the fully qualified name of this - * class as the key. - * - *

{@code EnvironmentPostProcessor} processors are encouraged to detect - * whether Spring's {@link org.springframework.core.Ordered Ordered} interface has been - * implemented or if the @{@link org.springframework.core.annotation.Order Order} - * annotation is present and to sort instances accordingly if so prior to invocation. + *

+ * EnvironmentPostProcessor implementations have to be registered in + * {@code META-INF/spring.factories}, using the fully qualified name of this class as the + * key. + *

+ * {@code EnvironmentPostProcessor} processors are encouraged to detect whether Spring's + * {@link org.springframework.core.Ordered Ordered} interface has been implemented or if + * the @{@link org.springframework.core.annotation.Order Order} annotation is present and + * to sort instances accordingly if so prior to invocation. * * @author Andy Wilkinson * @author Stephane Nicoll diff --git a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java b/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java index 8259081016..1deea39b65 100644 --- a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java +++ b/spring-boot/src/main/java/org/springframework/boot/orm/jpa/hibernate/SpringPhysicalNamingStrategy.java @@ -67,7 +67,8 @@ public class SpringPhysicalNamingStrategy implements PhysicalNamingStrategy { } StringBuilder text = new StringBuilder(name.getText().replace('.', '_')); for (int i = 1; i < text.length() - 1; i++) { - if (isUnderscoreRequired(text.charAt(i - 1), text.charAt(i), text.charAt(i + 1))) { + if (isUnderscoreRequired(text.charAt(i - 1), text.charAt(i), + text.charAt(i + 1))) { text.insert(i++, '_'); } } diff --git a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 96b7442c09..5461a70b48 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -826,8 +826,7 @@ public class ConfigFileApplicationListenerTests { assertThat(environment.containsProperty("customprofile")).isTrue(); assertThat(environment.containsProperty("customprofile-specific")).isTrue(); assertThat(environment.containsProperty("customprofile-customdefault")).isTrue(); - assertThat(environment.acceptsProfiles("customdefault")) - .isTrue(); + assertThat(environment.acceptsProfiles("customdefault")).isTrue(); } private Condition matchingPropertySource(