Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jul 14, 2018
1 parent c0574c8 commit ac1f2a5
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.boot.actuate.autoconfigure.security.reactive;

import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.boot.actuate.autoconfigure.security.servlet;

import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.boot.actuate.autoconfigure.security.servlet;

import org.springframework.boot.actuate.health.HealthEndpoint;
Expand All @@ -32,7 +33,6 @@
* configuration.
*
* @author Madhura Bhave
* @since 2.0.1
*/
@Configuration
class ManagementWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.boot.actuate.autoconfigure.security.reactive;

import java.net.URI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.boot.actuate.autoconfigure.security.servlet;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
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;

/**
Expand All @@ -34,7 +34,7 @@
* @author Stephane Nicoll
*/
@Order(0)
class SpringBootRepositoryRestConfigurer extends RepositoryRestConfigurerAdapter {
class SpringBootRepositoryRestConfigurer implements RepositoryRestConfigurer {

@Autowired(required = false)
private Jackson2ObjectMapperBuilder objectMapperBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,10 @@ public void nativeConnectionFactoryCustomHost() {
this.contextRunner.withUserConfiguration(EmptyConfiguration.class)
.withPropertyValues("spring.artemis.mode:native",
"spring.artemis.host:192.168.1.144", "spring.artemis.port:9876")
.run((context) -> {
assertNettyConnectionFactory(
getActiveMQConnectionFactory(
context.getBean(ConnectionFactory.class)),
"192.168.1.144", 9876);
});
.run((context) -> assertNettyConnectionFactory(
getActiveMQConnectionFactory(
context.getBean(ConnectionFactory.class)),
"192.168.1.144", 9876));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ public void hibernate5CustomNamingStrategiesViaJpaProperties() {

@Test
public void useNewIdGeneratorMappingsDefault() {
this.contextRunner.run(assertHibernateProperties((hibernateProperties) -> {
assertThat(hibernateProperties).containsEntry(
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true");
}));
this.contextRunner.run(assertHibernateProperties(
(hibernateProperties) -> assertThat(hibernateProperties).containsEntry(
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true")));
}

@Test
public void useNewIdGeneratorMappingsFalse() {
this.contextRunner
.withPropertyValues(
"spring.jpa.hibernate.use-new-id-generator-mappings:false")
.run(assertHibernateProperties((hibernateProperties) -> {
assertThat(hibernateProperties).containsEntry(
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "false");
}));
.run(assertHibernateProperties(
(hibernateProperties) -> assertThat(hibernateProperties)
.containsEntry(
AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
"false")));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ public void resourceHandlerMappingOverrideAll() {
@Test
public void resourceHandlerMappingDisabled() {
this.contextRunner.withPropertyValues("spring.resources.add-mappings:false")
.run((context) -> {
assertThat(context.getBean("resourceHandlerMapping")).isEqualTo(null);
});
.run((context) -> assertThat(context.getBean("resourceHandlerMapping"))
.isEqualTo(null));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ public void webServiceTemplateShouldApplyCustomizer() {
@Test
public void builderShouldBeFreshForEachUse() {
this.contextRunner.withUserConfiguration(DirtyWebServiceTemplateConfig.class)
.run((context) -> {
assertThat(context).hasNotFailed();
});
.run((context) -> assertThat(context).hasNotFailed());
}

private ContextConsumer<AssertableApplicationContext> assertWebServiceTemplateBuilder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.boot.docs.web.client;

import java.time.Duration;

import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -56,7 +58,8 @@ static class Config {

@Bean
public RestTemplateBuilder restTemplateBuilder() {
return new RestTemplateBuilder().setConnectTimeout(1000).setReadTimeout(1000);
return new RestTemplateBuilder().setConnectTimeout(Duration.ofSeconds(1))
.setReadTimeout(Duration.ofSeconds(1));
}

}
Expand Down

0 comments on commit ac1f2a5

Please sign in to comment.