Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
fc3fb7fb
Commit
fc3fb7fb
authored
Feb 19, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20226 from izeye
* pr/20226: Update copyright year of changed files Polish Closes gh-20226
parents
0c76c0ac
d65e0608
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
49 additions
and
65 deletions
+49
-65
ReactiveCloudFoundryActuatorAutoConfigurationTests.java
...e/ReactiveCloudFoundryActuatorAutoConfigurationTests.java
+2
-3
CloudFoundryActuatorAutoConfigurationTests.java
...y/servlet/CloudFoundryActuatorAutoConfigurationTests.java
+2
-3
WebFluxMetricsAutoConfigurationTests.java
...cs/web/reactive/WebFluxMetricsAutoConfigurationTests.java
+4
-5
WebMvcMetricsAutoConfigurationTests.java
...rics/web/servlet/WebMvcMetricsAutoConfigurationTests.java
+4
-5
SecurityRequestMatchersManagementContextConfigurationTests.java
...tyRequestMatchersManagementContextConfigurationTests.java
+3
-4
CassandraDataAutoConfigurationTests.java
...e/data/cassandra/CassandraDataAutoConfigurationTests.java
+1
-2
CassandraReactiveDataAutoConfigurationTests.java
...assandra/CassandraReactiveDataAutoConfigurationTests.java
+1
-2
KafkaAutoConfigurationTests.java
...boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
+2
-2
TaskExecutionAutoConfigurationTests.java
...toconfigure/task/TaskExecutionAutoConfigurationTests.java
+2
-4
WebMvcAutoConfigurationTests.java
...toconfigure/web/servlet/WebMvcAutoConfigurationTests.java
+15
-17
WebServicesAutoConfigurationTests.java
...figure/webservices/WebServicesAutoConfigurationTests.java
+2
-3
DataJpaTest.java
...ramework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
+1
-1
WebMvcTestAutoConfigurationIntegrationTests.java
.../servlet/WebMvcTestAutoConfigurationIntegrationTests.java
+2
-3
packaging-oci-image.adoc
...t-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc
+1
-1
TaskExecutorBuilderTests.java
...g/springframework/boot/task/TaskExecutorBuilderTests.java
+2
-3
RestTemplateBuilderTests.java
...ngframework/boot/web/client/RestTemplateBuilderTests.java
+2
-3
DelegatingFilterProxyRegistrationBeanTests.java
...b/servlet/DelegatingFilterProxyRegistrationBeanTests.java
+3
-4
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -240,8 +240,7 @@ class ReactiveCloudFoundryActuatorAutoConfigurationTests {
ExposableWebEndpoint
endpoint
=
endpoints
.
iterator
().
next
();
assertThat
(
endpoint
.
getOperations
()).
hasSize
(
2
);
WebOperation
webOperation
=
findOperationWithRequestPath
(
endpoint
,
"health"
);
Object
invoker
=
ReflectionTestUtils
.
getField
(
webOperation
,
"invoker"
);
assertThat
(
ReflectionTestUtils
.
getField
(
invoker
,
"target"
))
assertThat
(
webOperation
).
extracting
(
"invoker"
).
extracting
(
"target"
)
.
isInstanceOf
(
CloudFoundryReactiveHealthEndpointWebExtension
.
class
);
});
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -231,8 +231,7 @@ class CloudFoundryActuatorAutoConfigurationTests {
ExposableWebEndpoint
endpoint
=
endpoints
.
iterator
().
next
();
assertThat
(
endpoint
.
getOperations
()).
hasSize
(
2
);
WebOperation
webOperation
=
findOperationWithRequestPath
(
endpoint
,
"health"
);
Object
invoker
=
ReflectionTestUtils
.
getField
(
webOperation
,
"invoker"
);
assertThat
(
ReflectionTestUtils
.
getField
(
invoker
,
"target"
))
assertThat
(
webOperation
).
extracting
(
"invoker"
).
extracting
(
"target"
)
.
isInstanceOf
(
CloudFoundryHealthEndpointWebExtension
.
class
);
});
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/reactive/WebFluxMetricsAutoConfigurationTests.java
View file @
fc3fb7fb
...
...
@@ -33,7 +33,6 @@ import org.springframework.boot.test.system.CapturedOutput;
import
org.springframework.boot.test.system.OutputCaptureExtension
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.test.web.reactive.server.WebTestClient
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -57,8 +56,8 @@ class WebFluxMetricsAutoConfigurationTests {
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
).
getBeans
(
MetricsWebFilter
.
class
).
hasSize
(
1
);
assertThat
(
context
).
getBeans
(
DefaultWebFluxTagsProvider
.
class
).
hasSize
(
1
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
DefaultWebFluxTagsProvider
.
class
),
"ignoreTrailingSlash"
))
.
isEqualTo
(
true
);
assertThat
(
context
.
getBean
(
DefaultWebFluxTagsProvider
.
class
)).
extracting
(
"ignoreTrailingSlash"
)
.
isEqualTo
(
true
);
});
}
...
...
@@ -67,8 +66,8 @@ class WebFluxMetricsAutoConfigurationTests {
this
.
contextRunner
.
withPropertyValues
(
"management.metrics.web.server.request.ignore-trailing-slash=false"
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
DefaultWebFluxTagsProvider
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
DefaultWebFluxTagsProvider
.
class
),
"ignoreTrailingSlash"
))
.
isEqualTo
(
false
);
assertThat
(
context
.
getBean
(
DefaultWebFluxTagsProvider
.
class
)).
extracting
(
"ignoreTrailingSlash"
)
.
isEqualTo
(
false
);
});
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfigurationTests.java
View file @
fc3fb7fb
...
...
@@ -50,7 +50,6 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
...
...
@@ -84,8 +83,8 @@ class WebMvcMetricsAutoConfigurationTests {
void
definesTagsProviderAndFilterWhenMeterRegistryIsPresent
()
{
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
DefaultWebMvcTagsProvider
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
DefaultWebMvcTagsProvider
.
class
),
"ignoreTrailingSlash"
))
.
isEqualTo
(
true
);
assertThat
(
context
.
getBean
(
DefaultWebMvcTagsProvider
.
class
)).
extracting
(
"ignoreTrailingSlash"
)
.
isEqualTo
(
true
);
assertThat
(
context
).
hasSingleBean
(
FilterRegistrationBean
.
class
);
assertThat
(
context
.
getBean
(
FilterRegistrationBean
.
class
).
getFilter
())
.
isInstanceOf
(
WebMvcMetricsFilter
.
class
);
...
...
@@ -97,8 +96,8 @@ class WebMvcMetricsAutoConfigurationTests {
this
.
contextRunner
.
withPropertyValues
(
"management.metrics.web.server.request.ignore-trailing-slash=false"
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
DefaultWebMvcTagsProvider
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
DefaultWebMvcTagsProvider
.
class
),
"ignoreTrailingSlash"
))
.
isEqualTo
(
false
);
assertThat
(
context
.
getBean
(
DefaultWebMvcTagsProvider
.
class
)).
extracting
(
"ignoreTrailingSlash"
)
.
isEqualTo
(
false
);
});
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/SecurityRequestMatchersManagementContextConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -29,7 +29,6 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.web.util.matcher.RequestMatcher
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -64,7 +63,7 @@ class SecurityRequestMatchersManagementContextConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
TestMvcConfiguration
.
class
).
run
((
context
)
->
{
AntPathRequestMatcherProvider
matcherProvider
=
context
.
getBean
(
AntPathRequestMatcherProvider
.
class
);
RequestMatcher
requestMatcher
=
matcherProvider
.
getRequestMatcher
(
"/example"
);
assertThat
(
ReflectionTestUtils
.
getField
(
requestMatcher
,
"pattern"
)
).
isEqualTo
(
"/custom/example"
);
assertThat
(
requestMatcher
).
extracting
(
"pattern"
).
isEqualTo
(
"/custom/example"
);
});
}
...
...
@@ -75,7 +74,7 @@ class SecurityRequestMatchersManagementContextConfigurationTests {
AntPathRequestMatcherProvider
matcherProvider
=
context
.
getBean
(
AntPathRequestMatcherProvider
.
class
);
RequestMatcher
requestMatcher
=
matcherProvider
.
getRequestMatcher
(
"/example"
);
assertThat
(
ReflectionTestUtils
.
getField
(
requestMatcher
,
"pattern"
)
).
isEqualTo
(
"/admin/example"
);
assertThat
(
requestMatcher
).
extracting
(
"pattern"
).
isEqualTo
(
"/admin/example"
);
});
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java
View file @
fc3fb7fb
...
...
@@ -79,8 +79,7 @@ class CassandraDataAutoConfigurationTests {
void
userTypeResolverShouldBeSet
()
{
load
();
CassandraMappingContext
mappingContext
=
this
.
context
.
getBean
(
CassandraMappingContext
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
mappingContext
,
"userTypeResolver"
))
.
isInstanceOf
(
SimpleUserTypeResolver
.
class
);
assertThat
(
mappingContext
).
extracting
(
"userTypeResolver"
).
isInstanceOf
(
SimpleUserTypeResolver
.
class
);
}
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java
View file @
fc3fb7fb
...
...
@@ -75,8 +75,7 @@ class CassandraReactiveDataAutoConfigurationTests {
void
userTypeResolverShouldBeSet
()
{
load
(
"spring.data.cassandra.keyspaceName:boot_test"
);
CassandraMappingContext
mappingContext
=
this
.
context
.
getBean
(
CassandraMappingContext
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
mappingContext
,
"userTypeResolver"
))
.
isInstanceOf
(
SimpleUserTypeResolver
.
class
);
assertThat
(
mappingContext
).
extracting
(
"userTypeResolver"
).
isInstanceOf
(
SimpleUserTypeResolver
.
class
);
}
private
void
load
(
String
...
environment
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -389,7 +389,7 @@ class KafkaAutoConfigurationTests {
assertThat
(
containerProperties
.
getMonitorInterval
()).
isEqualTo
(
45
);
assertThat
(
containerProperties
.
isLogContainerConfig
()).
isTrue
();
assertThat
(
containerProperties
.
isMissingTopicsFatal
()).
isFalse
();
assertThat
(
ReflectionTestUtils
.
getField
(
kafkaListenerContainerFactory
,
"concurrency"
)
).
isEqualTo
(
3
);
assertThat
(
kafkaListenerContainerFactory
).
extracting
(
"concurrency"
).
isEqualTo
(
3
);
assertThat
(
kafkaListenerContainerFactory
.
isBatchListener
()).
isTrue
();
assertThat
(
context
.
getBeansOfType
(
KafkaJaasLoginModuleInitializer
.
class
)).
hasSize
(
1
);
KafkaJaasLoginModuleInitializer
jaas
=
context
.
getBean
(
KafkaJaasLoginModuleInitializer
.
class
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/task/TaskExecutionAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -41,7 +41,6 @@ import org.springframework.scheduling.annotation.AsyncResult;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
Mockito
.
mock
;
...
...
@@ -92,8 +91,7 @@ class TaskExecutionAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
TaskDecoratorConfig
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
TaskExecutorBuilder
.
class
);
ThreadPoolTaskExecutor
executor
=
context
.
getBean
(
TaskExecutorBuilder
.
class
).
build
();
assertThat
(
ReflectionTestUtils
.
getField
(
executor
,
"taskDecorator"
))
.
isSameAs
(
context
.
getBean
(
TaskDecorator
.
class
));
assertThat
(
executor
).
extracting
(
"taskDecorator"
).
isSameAs
(
context
.
getBean
(
TaskDecorator
.
class
));
});
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -380,16 +380,15 @@ class WebMvcAutoConfigurationTests {
@Test
void
defaultAsyncRequestTimeout
()
{
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"asyncRequestTimeout"
)
).
isNull
());
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
))
.
extracting
(
"asyncRequestTimeout"
).
isNull
());
}
@Test
void
customAsyncRequestTimeout
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.mvc.async.request-timeout:12345"
)
.
run
((
context
)
->
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"asyncRequestTimeout"
))
.
isEqualTo
(
12345L
));
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
))
.
extracting
(
"asyncRequestTimeout"
).
isEqualTo
(
12345L
));
}
@Test
...
...
@@ -397,8 +396,8 @@ class WebMvcAutoConfigurationTests {
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
))
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
AsyncTaskExecutor
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
))
.
isSameAs
(
context
.
getBean
(
"applicationTaskExecutor"
));
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
)).
extracting
(
"taskExecutor"
)
.
isSameAs
(
context
.
getBean
(
"applicationTaskExecutor"
));
});
}
...
...
@@ -407,8 +406,8 @@ class WebMvcAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
CustomApplicationTaskExecutorConfig
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
)).
run
((
context
)
->
{
assertThat
(
context
).
doesNotHaveBean
(
AsyncTaskExecutor
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
))
.
isNotSameAs
(
context
.
getBean
(
"applicationTaskExecutor"
));
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
)).
extracting
(
"taskExecutor"
)
.
isNotSameAs
(
context
.
getBean
(
"applicationTaskExecutor"
));
});
}
...
...
@@ -416,9 +415,9 @@ class WebMvcAutoConfigurationTests {
void
asyncTaskExecutorWithMvcConfigurerCanOverrideExecutor
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomAsyncTaskExecutorConfigurer
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
))
.
run
((
context
)
->
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
)
)
.
isSameAs
(
context
.
getBean
(
CustomAsyncTaskExecutorConfigurer
.
class
).
taskExecutor
));
.
run
((
context
)
->
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
))
.
extracting
(
"taskExecutor"
)
.
isSameAs
(
context
.
getBean
(
CustomAsyncTaskExecutorConfigurer
.
class
).
taskExecutor
));
}
@Test
...
...
@@ -426,8 +425,8 @@ class WebMvcAutoConfigurationTests {
this
.
contextRunner
.
withUserConfiguration
(
CustomAsyncTaskExecutorConfig
.
class
)
.
withConfiguration
(
AutoConfigurations
.
of
(
TaskExecutionAutoConfiguration
.
class
)).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
AsyncTaskExecutor
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
))
.
isNotSameAs
(
context
.
getBean
(
"customTaskExecutor"
));
assertThat
(
context
.
getBean
(
RequestMappingHandlerAdapter
.
class
)).
extracting
(
"taskExecutor"
)
.
isNotSameAs
(
context
.
getBean
(
"customTaskExecutor"
));
});
}
...
...
@@ -643,8 +642,7 @@ class WebMvcAutoConfigurationTests {
Validator
validator
=
context
.
getBean
(
Validator
.
class
);
assertThat
(
validator
).
isInstanceOf
(
ValidatorAdapter
.
class
);
Validator
target
=
((
ValidatorAdapter
)
validator
).
getTarget
();
assertThat
(
ReflectionTestUtils
.
getField
(
target
,
"targetValidator"
))
.
isSameAs
(
context
.
getBean
(
"customJsr303Validator"
));
assertThat
(
target
).
extracting
(
"targetValidator"
).
isSameAs
(
context
.
getBean
(
"customJsr303Validator"
));
});
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import
org.springframework.boot.test.context.runner.WebApplicationContextRunner
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition
;
import
org.springframework.xml.xsd.SimpleXsdSchema
;
...
...
@@ -72,7 +71,7 @@ class WebServicesAutoConfigurationTests {
void
customLoadOnStartup
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.webservices.servlet.load-on-startup=1"
).
run
((
context
)
->
{
ServletRegistrationBean
<?>
registrationBean
=
context
.
getBean
(
ServletRegistrationBean
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
registrationBean
,
"loadOnStartup"
)
).
isEqualTo
(
1
);
assertThat
(
registrationBean
).
extracting
(
"loadOnStartup"
).
isEqualTo
(
1
);
});
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java
View file @
fc3fb7fb
...
...
@@ -104,7 +104,7 @@ public @interface DataJpaTest {
/**
* The {@link BootstrapMode} for the test repository support. Defaults to
* {@link BootstrapMode#LAZY}.
* @return the {@link BootstrapMode} to use for test the repository
* @return the {@link BootstrapMode} to use for test
ing
the repository
*/
@PropertyMapping
(
"spring.data.jpa.repositories.bootstrap-mode"
)
BootstrapMode
bootstrapMode
()
default
BootstrapMode
.
LAZY
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestAutoConfigurationIntegrationTests.java
View file @
fc3fb7fb
...
...
@@ -28,7 +28,6 @@ import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguratio
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.core.task.AsyncTaskExecutor
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -75,8 +74,8 @@ class WebMvcTestAutoConfigurationIntegrationTests {
@Test
void
asyncTaskExecutorWithApplicationTaskExecutor
()
{
assertThat
(
this
.
applicationContext
.
getBeansOfType
(
AsyncTaskExecutor
.
class
)).
hasSize
(
1
);
assertThat
(
ReflectionTestUtils
.
getField
(
this
.
applicationContext
.
getBean
(
RequestMappingHandlerAdapter
.
class
),
"taskExecutor"
))
.
isSameAs
(
this
.
applicationContext
.
getBean
(
"applicationTaskExecutor"
));
assertThat
(
this
.
applicationContext
.
getBean
(
RequestMappingHandlerAdapter
.
class
)).
extracting
(
"taskExecutor"
)
.
isSameAs
(
this
.
applicationContext
.
getBean
(
"applicationTaskExecutor"
));
}
@Test
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc
View file @
fc3fb7fb
...
...
@@ -4,7 +4,7 @@
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] using https://buildpacks.io/[Cloud Native Buildpacks].
Images can be built using the `build-image` goal and a local Docker installation.
The easiest way to get started is to
to
invoke `mvn spring-boot:build-image` on a project.
The easiest way to get started is to invoke `mvn spring-boot:build-image` on a project.
It is possible to automate the creation of an image whenever the `package` phase is invoked, as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"]
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/task/TaskExecutorBuilderTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test;
import
org.springframework.core.task.TaskDecorator
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalArgumentException
;
...
...
@@ -76,7 +75,7 @@ class TaskExecutorBuilderTests {
void
taskDecoratorShouldApply
()
{
TaskDecorator
taskDecorator
=
mock
(
TaskDecorator
.
class
);
ThreadPoolTaskExecutor
executor
=
this
.
builder
.
taskDecorator
(
taskDecorator
).
build
();
assertThat
(
ReflectionTestUtils
.
getField
(
executor
,
"taskDecorator"
)
).
isSameAs
(
taskDecorator
);
assertThat
(
executor
).
extracting
(
"taskDecorator"
).
isSameAs
(
taskDecorator
);
}
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -541,8 +541,7 @@ class RestTemplateBuilderTests {
void
readTimeoutCanBeConfiguredOnOkHttp3RequestFactory
()
{
ClientHttpRequestFactory
requestFactory
=
this
.
builder
.
requestFactory
(
OkHttp3ClientHttpRequestFactory
.
class
)
.
setReadTimeout
(
Duration
.
ofMillis
(
1234
)).
build
().
getRequestFactory
();
assertThat
(
ReflectionTestUtils
.
getField
(
ReflectionTestUtils
.
getField
(
requestFactory
,
"client"
),
"readTimeout"
))
.
isEqualTo
(
1234
);
assertThat
(
requestFactory
).
extracting
(
"client"
).
extracting
(
"readTimeout"
).
isEqualTo
(
1234
);
}
@Test
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java
View file @
fc3fb7fb
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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.
...
...
@@ -29,7 +29,6 @@ import org.springframework.mock.web.MockFilterConfig;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.mock.web.MockHttpServletResponse
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.web.context.support.GenericWebApplicationContext
;
import
org.springframework.web.filter.DelegatingFilterProxy
;
import
org.springframework.web.filter.GenericFilterBean
;
...
...
@@ -72,8 +71,8 @@ class DelegatingFilterProxyRegistrationBeanTests extends AbstractFilterRegistrat
DelegatingFilterProxyRegistrationBean
registrationBean
=
createFilterRegistrationBean
();
Filter
filter
=
registrationBean
.
getFilter
();
assertThat
(
filter
).
isInstanceOf
(
DelegatingFilterProxy
.
class
);
assertThat
(
ReflectionTestUtils
.
getField
(
filter
,
"webApplicationContext"
)
).
isEqualTo
(
this
.
applicationContext
);
assertThat
(
ReflectionTestUtils
.
getField
(
filter
,
"targetBeanName"
)
).
isEqualTo
(
"mockFilter"
);
assertThat
(
filter
).
extracting
(
"webApplicationContext"
).
isEqualTo
(
this
.
applicationContext
);
assertThat
(
filter
).
extracting
(
"targetBeanName"
).
isEqualTo
(
"mockFilter"
);
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment