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
7536d88e
Commit
7536d88e
authored
Jul 09, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17413 from izeye
* pr/17413: Polish Closes gh-17413
parents
939a247d
426ef749
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
18 deletions
+19
-18
ReactiveWebServerFactoryAutoConfigurationTests.java
...ctive/ReactiveWebServerFactoryAutoConfigurationTests.java
+2
-3
DevToolsEnablementDeducer.java
...ingframework/boot/devtools/DevToolsEnablementDeducer.java
+1
-1
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+1
-1
spring-boot-features.adoc
...ing-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+3
-3
SpringBootTestContextBootstrapper.java
.../boot/test/context/SpringBootTestContextBootstrapper.java
+1
-1
MockDefinition.java
...pringframework/boot/test/mock/mockito/MockDefinition.java
+3
-2
SpyDefinition.java
...springframework/boot/test/mock/mockito/SpyDefinition.java
+3
-1
DefaultErrorAttributes.java
...ework/boot/web/reactive/error/DefaultErrorAttributes.java
+1
-1
ConfigurationPropertiesScanTests.java
.../context/properties/ConfigurationPropertiesScanTests.java
+2
-2
WebServiceTemplateBuilderTests.java
...ot/webservices/client/WebServiceTemplateBuilderTests.java
+2
-3
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryAutoConfigurationTests.java
View file @
7536d88e
...
@@ -21,7 +21,6 @@ import org.apache.catalina.connector.Connector;
...
@@ -21,7 +21,6 @@ import org.apache.catalina.connector.Connector;
import
org.apache.catalina.startup.Tomcat
;
import
org.apache.catalina.startup.Tomcat
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.server.Server
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.Mockito
;
import
reactor.netty.http.server.HttpServer
;
import
reactor.netty.http.server.HttpServer
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
...
@@ -275,7 +274,7 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
...
@@ -275,7 +274,7 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
@Bean
@Bean
HttpHandler
httpHandler
()
{
HttpHandler
httpHandler
()
{
return
Mockito
.
mock
(
HttpHandler
.
class
);
return
mock
(
HttpHandler
.
class
);
}
}
}
}
...
@@ -285,7 +284,7 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
...
@@ -285,7 +284,7 @@ class ReactiveWebServerFactoryAutoConfigurationTests {
@Bean
@Bean
HttpHandler
additionalHttpHandler
()
{
HttpHandler
additionalHttpHandler
()
{
return
Mockito
.
mock
(
HttpHandler
.
class
);
return
mock
(
HttpHandler
.
class
);
}
}
}
}
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/DevToolsEnablementDeducer.java
View file @
7536d88e
...
@@ -46,7 +46,7 @@ public final class DevToolsEnablementDeducer {
...
@@ -46,7 +46,7 @@ public final class DevToolsEnablementDeducer {
* Checks if a specific {@link StackTraceElement} in the current thread's stacktrace
* Checks if a specific {@link StackTraceElement} in the current thread's stacktrace
* should cause devtools to be disabled.
* should cause devtools to be disabled.
* @param thread the current thread
* @param thread the current thread
* @return {@code true} if devtools should be enabled
skipped
* @return {@code true} if devtools should be enabled
*/
*/
public
static
boolean
shouldEnable
(
Thread
thread
)
{
public
static
boolean
shouldEnable
(
Thread
thread
)
{
for
(
StackTraceElement
element
:
thread
.
getStackTrace
())
{
for
(
StackTraceElement
element
:
thread
.
getStackTrace
())
{
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
7536d88e
...
@@ -1982,7 +1982,7 @@ following information:
...
@@ -1982,7 +1982,7 @@ following information:
|`status`
|`status`
|Response's HTTP status code if available (for example, `200` or `500`),
|Response's HTTP status code if available (for example, `200` or `500`),
or `IO_ERROR` in case o
r
I/O issues, `CLIENT_ERROR` otherwise
or `IO_ERROR` in case o
f
I/O issues, `CLIENT_ERROR` otherwise
|`uri`
|`uri`
|Request's URI template prior to variable substitution, if possible (for example,
|Request's URI template prior to variable substitution, if possible (for example,
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
7536d88e
...
@@ -3560,12 +3560,12 @@ The following code shows a typical example:
...
@@ -3560,12 +3560,12 @@ The following code shows a typical example:
public MyService(RSocketRequester.Builder rsocketRequesterBuilder) {
public MyService(RSocketRequester.Builder rsocketRequesterBuilder) {
this.rsocketRequester = rsocketRequesterBuilder
this.rsocketRequester = rsocketRequesterBuilder
.connectTcp("example.org", 9090).block();
.connectTcp("example.org", 9090).block();
}
}
public Mono<User> someRSocketCall(String name) {
public Mono<User> someRSocketCall(String name) {
return this.requester.route("user").data(
payload
)
return this.requester.route("user").data(
name
)
.retrieveMono(User.class);
.retrieveMono(User.class);
}
}
}
}
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java
View file @
7536d88e
...
@@ -191,7 +191,7 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr
...
@@ -191,7 +191,7 @@ public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstr
* Determines the resource base path for web applications using the value of
* Determines the resource base path for web applications using the value of
* {@link WebAppConfiguration @WebAppConfiguration}, if any, on the test class of the
* {@link WebAppConfiguration @WebAppConfiguration}, if any, on the test class of the
* given {@code configuration}. Defaults to {@code src/main/webapp} in its absence.
* given {@code configuration}. Defaults to {@code src/main/webapp} in its absence.
* @param configuration the configur
e
to examine
* @param configuration the configur
ation
to examine
* @return the resource base path
* @return the resource base path
* @since 2.1.6
* @since 2.1.6
*/
*/
...
...
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockDefinition.java
View file @
7536d88e
...
@@ -23,7 +23,6 @@ import java.util.Set;
...
@@ -23,7 +23,6 @@ import java.util.Set;
import
org.mockito.Answers
;
import
org.mockito.Answers
;
import
org.mockito.MockSettings
;
import
org.mockito.MockSettings
;
import
org.mockito.Mockito
;
import
org.springframework.core.ResolvableType
;
import
org.springframework.core.ResolvableType
;
import
org.springframework.core.style.ToStringCreator
;
import
org.springframework.core.style.ToStringCreator
;
...
@@ -32,6 +31,8 @@ import org.springframework.util.ClassUtils;
...
@@ -32,6 +31,8 @@ import org.springframework.util.ClassUtils;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
* A complete definition that can be used to create a Mockito mock.
* A complete definition that can be used to create a Mockito mock.
*
*
...
@@ -150,7 +151,7 @@ class MockDefinition extends Definition {
...
@@ -150,7 +151,7 @@ class MockDefinition extends Definition {
if
(
this
.
serializable
)
{
if
(
this
.
serializable
)
{
settings
.
serializable
();
settings
.
serializable
();
}
}
return
(
T
)
Mockito
.
mock
(
this
.
typeToMock
.
resolve
(),
settings
);
return
(
T
)
mock
(
this
.
typeToMock
.
resolve
(),
settings
);
}
}
}
}
spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyDefinition.java
View file @
7536d88e
...
@@ -28,6 +28,8 @@ import org.springframework.util.Assert;
...
@@ -28,6 +28,8 @@ import org.springframework.util.Assert;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
* A complete definition that can be used to create a Mockito spy.
* A complete definition that can be used to create a Mockito spy.
*
*
...
@@ -98,7 +100,7 @@ class SpyDefinition extends Definition {
...
@@ -98,7 +100,7 @@ class SpyDefinition extends Definition {
if
(
this
.
isProxyTargetAware
())
{
if
(
this
.
isProxyTargetAware
())
{
settings
.
verificationStartedListeners
(
new
SpringAopBypassingVerificationStartedListener
());
settings
.
verificationStartedListeners
(
new
SpringAopBypassingVerificationStartedListener
());
}
}
return
(
T
)
Mockito
.
mock
(
instance
.
getClass
(),
settings
);
return
(
T
)
mock
(
instance
.
getClass
(),
settings
);
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/error/DefaultErrorAttributes.java
View file @
7536d88e
...
@@ -46,7 +46,7 @@ import org.springframework.web.server.ServerWebExchange;
...
@@ -46,7 +46,7 @@ import org.springframework.web.server.ServerWebExchange;
* <li>errors - Any {@link ObjectError}s from a {@link BindingResult} exception
* <li>errors - Any {@link ObjectError}s from a {@link BindingResult} exception
* <li>trace - The exception stack trace</li>
* <li>trace - The exception stack trace</li>
* <li>path - The URL path when the exception was raised</li>
* <li>path - The URL path when the exception was raised</li>
* <li>requestId - Unique I
d
associated with the current request</li>
* <li>requestId - Unique I
D
associated with the current request</li>
* </ul>
* </ul>
*
*
* @author Brian Clozel
* @author Brian Clozel
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanTests.java
View file @
7536d88e
...
@@ -19,7 +19,6 @@ package org.springframework.boot.context.properties;
...
@@ -19,7 +19,6 @@ package org.springframework.boot.context.properties;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.Mockito
;
import
org.springframework.boot.context.properties.scan.valid.a.AScanConfiguration
;
import
org.springframework.boot.context.properties.scan.valid.a.AScanConfiguration
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
...
@@ -29,6 +28,7 @@ import org.springframework.core.io.DefaultResourceLoader;
...
@@ -29,6 +28,7 @@ import org.springframework.core.io.DefaultResourceLoader;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
BDDMockito
.
willCallRealMethod
;
import
static
org
.
mockito
.
BDDMockito
.
willCallRealMethod
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
* Integration tests for {@link ConfigurationPropertiesScan @ConfigurationPropertiesScan}.
* Integration tests for {@link ConfigurationPropertiesScan @ConfigurationPropertiesScan}.
...
@@ -71,7 +71,7 @@ class ConfigurationPropertiesScanTests {
...
@@ -71,7 +71,7 @@ class ConfigurationPropertiesScanTests {
@Test
@Test
void
scanImportBeanRegistrarShouldBeResourceLoaderAwareWithRequiredResource
()
{
void
scanImportBeanRegistrarShouldBeResourceLoaderAwareWithRequiredResource
()
{
DefaultResourceLoader
resourceLoader
=
Mockito
.
mock
(
DefaultResourceLoader
.
class
);
DefaultResourceLoader
resourceLoader
=
mock
(
DefaultResourceLoader
.
class
);
this
.
context
.
setResourceLoader
(
resourceLoader
);
this
.
context
.
setResourceLoader
(
resourceLoader
);
willCallRealMethod
().
given
(
resourceLoader
).
getClassLoader
();
willCallRealMethod
().
given
(
resourceLoader
).
getClassLoader
();
given
(
resourceLoader
.
getResource
(
"test"
)).
willReturn
(
new
ByteArrayResource
(
"test"
.
getBytes
()));
given
(
resourceLoader
.
getResource
(
"test"
)).
willReturn
(
new
ByteArrayResource
(
"test"
.
getBytes
()));
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java
View file @
7536d88e
...
@@ -26,7 +26,6 @@ import javax.xml.transform.sax.SAXTransformerFactory;
...
@@ -26,7 +26,6 @@ import javax.xml.transform.sax.SAXTransformerFactory;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.Mock
;
import
org.mockito.Mock
;
import
org.mockito.Mockito
;
import
org.mockito.MockitoAnnotations
;
import
org.mockito.MockitoAnnotations
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
...
@@ -199,8 +198,8 @@ class WebServiceTemplateBuilderTests {
...
@@ -199,8 +198,8 @@ class WebServiceTemplateBuilderTests {
@Test
@Test
void
additionalInterceptorsShouldAddToExistingWebServiceTemplate
()
{
void
additionalInterceptorsShouldAddToExistingWebServiceTemplate
()
{
ClientInterceptor
f1
=
Mockito
.
mock
(
ClientInterceptor
.
class
);
ClientInterceptor
f1
=
mock
(
ClientInterceptor
.
class
);
ClientInterceptor
f2
=
Mockito
.
mock
(
ClientInterceptor
.
class
);
ClientInterceptor
f2
=
mock
(
ClientInterceptor
.
class
);
WebServiceTemplate
webServiceTemplate
=
new
WebServiceTemplate
();
WebServiceTemplate
webServiceTemplate
=
new
WebServiceTemplate
();
webServiceTemplate
.
setInterceptors
(
new
ClientInterceptor
[]
{
f1
});
webServiceTemplate
.
setInterceptors
(
new
ClientInterceptor
[]
{
f1
});
this
.
builder
.
additionalInterceptors
(
f2
).
configure
(
webServiceTemplate
);
this
.
builder
.
additionalInterceptors
(
f2
).
configure
(
webServiceTemplate
);
...
...
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