Polish
This commit is contained in:
parent
2be554456e
commit
9fdb563d5a
|
|
@ -58,8 +58,8 @@ public class ValidationAutoConfiguration {
|
|||
@Override
|
||||
public ConditionOutcome getMatchOutcome(ConditionContext context,
|
||||
AnnotatedTypeMetadata metadata) {
|
||||
ConditionMessage.Builder message = ConditionMessage.forCondition(
|
||||
getClass().getName());
|
||||
ConditionMessage.Builder message = ConditionMessage
|
||||
.forCondition(getClass().getName());
|
||||
try {
|
||||
Validation.buildDefaultValidatorFactory().getValidator();
|
||||
return ConditionOutcome.match(message.available("JSR-303 provider"));
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ public class CassandraAutoConfigurationTests {
|
|||
public void createCustomizeCluster() {
|
||||
load(ClusterConfig.class);
|
||||
assertThat(this.context.getBeanNamesForType(Cluster.class).length).isEqualTo(1);
|
||||
assertThat(this.context.getBeanNamesForType(ClusterCustomizer.class).length).isEqualTo(1);
|
||||
assertThat(this.context.getBeanNamesForType(ClusterCustomizer.class).length)
|
||||
.isEqualTo(1);
|
||||
}
|
||||
|
||||
private void load(String... environment) {
|
||||
|
|
@ -85,7 +86,6 @@ public class CassandraAutoConfigurationTests {
|
|||
this.context = ctx;
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class ClusterConfig {
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,9 @@ public class SessionAutoConfigurationHazelcastTests
|
|||
"spring.session.hazelcast.flush-mode=immediate");
|
||||
HazelcastSessionRepository repository = validateSessionRepository(
|
||||
HazelcastSessionRepository.class);
|
||||
assertThat(new DirectFieldAccessor(repository).getPropertyValue(
|
||||
"hazelcastFlushMode")).isEqualTo(HazelcastFlushMode.IMMEDIATE);
|
||||
assertThat(new DirectFieldAccessor(repository)
|
||||
.getPropertyValue("hazelcastFlushMode"))
|
||||
.isEqualTo(HazelcastFlushMode.IMMEDIATE);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ public class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurat
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void mongoSessionStore() {
|
||||
load(Arrays.asList(EmbeddedMongoAutoConfiguration.class,
|
||||
MongoAutoConfiguration.class, MongoDataAutoConfiguration.class),
|
||||
|
|
@ -106,7 +105,6 @@ public class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurat
|
|||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void mongoSessionStoreWithCustomizations() {
|
||||
load(Arrays.asList(EmbeddedMongoAutoConfiguration.class,
|
||||
MongoAutoConfiguration.class, MongoDataAutoConfiguration.class),
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ public class ValidationAutoConfigurationTests {
|
|||
load(SampleConfiguration.class);
|
||||
assertThat(this.context.getBean(MethodValidationPostProcessor.class))
|
||||
.isSameAs(this.context.getBean("testMethodValidationPostProcessor"));
|
||||
assertThat(this.context.getBeansOfType(MethodValidationPostProcessor.class)).hasSize(1);
|
||||
assertThat(this.context.getBeansOfType(MethodValidationPostProcessor.class))
|
||||
.hasSize(1);
|
||||
}
|
||||
|
||||
public void load(Class<?> config) {
|
||||
|
|
@ -84,6 +85,7 @@ public class ValidationAutoConfigurationTests {
|
|||
public void doSomething(@Size(min = 3, max = 10) String name) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Test for {{@link ValidationAutoConfiguration} when Hibernate validator is present
|
||||
* but no EL implementation is available.
|
||||
* Test for {@link ValidationAutoConfiguration} when Hibernate validator is present but no
|
||||
* EL implementation is available.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -435,10 +435,8 @@ public class ServerPropertiesTests {
|
|||
map.put("server.tomcat.port-header", "x-my-forward-port");
|
||||
map.put("server.tomcat.protocol-header-https-value", "On");
|
||||
bindProperties(map);
|
||||
|
||||
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
|
||||
this.properties.customize(container);
|
||||
|
||||
assertThat(container.getEngineValves()).hasSize(1);
|
||||
Valve valve = container.getEngineValves().iterator().next();
|
||||
assertThat(valve).isInstanceOf(RemoteIpValve.class);
|
||||
|
|
@ -455,7 +453,6 @@ public class ServerPropertiesTests {
|
|||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("server.tomcat.accept-count", "10");
|
||||
bindProperties(map);
|
||||
|
||||
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
|
||||
this.properties.customize(container);
|
||||
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
|
||||
|
|
@ -469,7 +466,6 @@ public class ServerPropertiesTests {
|
|||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("server.tomcat.max-connections", "5");
|
||||
bindProperties(map);
|
||||
|
||||
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
|
||||
this.properties.customize(container);
|
||||
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
|
||||
|
|
@ -483,7 +479,6 @@ public class ServerPropertiesTests {
|
|||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("server.tomcat.max-http-post-size", "10000");
|
||||
bindProperties(map);
|
||||
|
||||
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
|
||||
this.properties.customize(container);
|
||||
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
|
||||
|
|
@ -498,7 +493,6 @@ public class ServerPropertiesTests {
|
|||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("server.max-http-post-size", "2000");
|
||||
bindProperties(map);
|
||||
|
||||
TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory();
|
||||
this.properties.customize(container);
|
||||
TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container
|
||||
|
|
|
|||
Loading…
Reference in New Issue