Commit ac1f2a58 authored by Andy Wilkinson's avatar Andy Wilkinson

Polish

parent c0574c84
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.security.reactive; package org.springframework.boot.actuate.autoconfigure.security.reactive;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.security.servlet; package org.springframework.boot.actuate.autoconfigure.security.servlet;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.security.servlet; package org.springframework.boot.actuate.autoconfigure.security.servlet;
import org.springframework.boot.actuate.health.HealthEndpoint; import org.springframework.boot.actuate.health.HealthEndpoint;
...@@ -32,7 +33,6 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur ...@@ -32,7 +33,6 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
* configuration. * configuration.
* *
* @author Madhura Bhave * @author Madhura Bhave
* @since 2.0.1
*/ */
@Configuration @Configuration
class ManagementWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { class ManagementWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.security.reactive; package org.springframework.boot.actuate.autoconfigure.security.reactive;
import java.net.URI; import java.net.URI;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.security.servlet; package org.springframework.boot.actuate.autoconfigure.security.servlet;
import java.io.IOException; import java.io.IOException;
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; ...@@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
/** /**
...@@ -34,7 +34,7 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; ...@@ -34,7 +34,7 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
@Order(0) @Order(0)
class SpringBootRepositoryRestConfigurer extends RepositoryRestConfigurerAdapter { class SpringBootRepositoryRestConfigurer implements RepositoryRestConfigurer {
@Autowired(required = false) @Autowired(required = false)
private Jackson2ObjectMapperBuilder objectMapperBuilder; private Jackson2ObjectMapperBuilder objectMapperBuilder;
......
...@@ -143,12 +143,10 @@ public class ArtemisAutoConfigurationTests { ...@@ -143,12 +143,10 @@ public class ArtemisAutoConfigurationTests {
this.contextRunner.withUserConfiguration(EmptyConfiguration.class) this.contextRunner.withUserConfiguration(EmptyConfiguration.class)
.withPropertyValues("spring.artemis.mode:native", .withPropertyValues("spring.artemis.mode:native",
"spring.artemis.host:192.168.1.144", "spring.artemis.port:9876") "spring.artemis.host:192.168.1.144", "spring.artemis.port:9876")
.run((context) -> { .run((context) -> assertNettyConnectionFactory(
assertNettyConnectionFactory( getActiveMQConnectionFactory(
getActiveMQConnectionFactory( context.getBean(ConnectionFactory.class)),
context.getBean(ConnectionFactory.class)), "192.168.1.144", 9876));
"192.168.1.144", 9876);
});
} }
@Test @Test
......
...@@ -106,10 +106,9 @@ public class HibernatePropertiesTests { ...@@ -106,10 +106,9 @@ public class HibernatePropertiesTests {
@Test @Test
public void useNewIdGeneratorMappingsDefault() { public void useNewIdGeneratorMappingsDefault() {
this.contextRunner.run(assertHibernateProperties((hibernateProperties) -> { this.contextRunner.run(assertHibernateProperties(
assertThat(hibernateProperties).containsEntry( (hibernateProperties) -> assertThat(hibernateProperties).containsEntry(
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true")));
}));
} }
@Test @Test
...@@ -117,10 +116,11 @@ public class HibernatePropertiesTests { ...@@ -117,10 +116,11 @@ public class HibernatePropertiesTests {
this.contextRunner this.contextRunner
.withPropertyValues( .withPropertyValues(
"spring.jpa.hibernate.use-new-id-generator-mappings:false") "spring.jpa.hibernate.use-new-id-generator-mappings:false")
.run(assertHibernateProperties((hibernateProperties) -> { .run(assertHibernateProperties(
assertThat(hibernateProperties).containsEntry( (hibernateProperties) -> assertThat(hibernateProperties)
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "false"); .containsEntry(
})); AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
"false")));
} }
@Test @Test
......
...@@ -190,9 +190,8 @@ public class WebMvcAutoConfigurationTests { ...@@ -190,9 +190,8 @@ public class WebMvcAutoConfigurationTests {
@Test @Test
public void resourceHandlerMappingDisabled() { public void resourceHandlerMappingDisabled() {
this.contextRunner.withPropertyValues("spring.resources.add-mappings:false") this.contextRunner.withPropertyValues("spring.resources.add-mappings:false")
.run((context) -> { .run((context) -> assertThat(context.getBean("resourceHandlerMapping"))
assertThat(context.getBean("resourceHandlerMapping")).isEqualTo(null); .isEqualTo(null));
});
} }
@Test @Test
......
...@@ -93,9 +93,7 @@ public class WebServiceTemplateAutoConfigurationTests { ...@@ -93,9 +93,7 @@ public class WebServiceTemplateAutoConfigurationTests {
@Test @Test
public void builderShouldBeFreshForEachUse() { public void builderShouldBeFreshForEachUse() {
this.contextRunner.withUserConfiguration(DirtyWebServiceTemplateConfig.class) this.contextRunner.withUserConfiguration(DirtyWebServiceTemplateConfig.class)
.run((context) -> { .run((context) -> assertThat(context).hasNotFailed());
assertThat(context).hasNotFailed();
});
} }
private ContextConsumer<AssertableApplicationContext> assertWebServiceTemplateBuilder( private ContextConsumer<AssertableApplicationContext> assertWebServiceTemplateBuilder(
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
package org.springframework.boot.docs.web.client; package org.springframework.boot.docs.web.client;
import java.time.Duration;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -56,7 +58,8 @@ public class SampleWebClientTests { ...@@ -56,7 +58,8 @@ public class SampleWebClientTests {
@Bean @Bean
public RestTemplateBuilder restTemplateBuilder() { public RestTemplateBuilder restTemplateBuilder() {
return new RestTemplateBuilder().setConnectTimeout(1000).setReadTimeout(1000); return new RestTemplateBuilder().setConnectTimeout(Duration.ofSeconds(1))
.setReadTimeout(Duration.ofSeconds(1));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment