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
ec15607b
Commit
ec15607b
authored
Dec 25, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
548ff239
37519ecf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
TestRestTemplate.java
...pringframework/boot/test/web/client/TestRestTemplate.java
+6
-6
TestRestTemplateTests.java
...framework/boot/test/web/client/TestRestTemplateTests.java
+11
-0
No files found.
spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java
View file @
ec15607b
...
...
@@ -575,10 +575,10 @@ public class TestRestTemplate {
* @param <T> the type of the return value
* @return the converted object
* @throws RestClientException on client-side HTTP error
* @since 1.4.4
* @see HttpEntity
* @since 1.4.3
*/
<
T
>
T
patchForObject
(
String
url
,
Object
request
,
Class
<
T
>
responseType
,
public
<
T
>
T
patchForObject
(
String
url
,
Object
request
,
Class
<
T
>
responseType
,
Object
...
uriVariables
)
throws
RestClientException
{
return
this
.
restTemplate
.
patchForObject
(
url
,
request
,
responseType
,
uriVariables
);
}
...
...
@@ -598,10 +598,10 @@ public class TestRestTemplate {
* @param <T> the type of the return value
* @return the converted object
* @throws RestClientException on client-side HTTP error
* @since 1.4.4
* @see HttpEntity
* @since 1.4.3
*/
<
T
>
T
patchForObject
(
String
url
,
Object
request
,
Class
<
T
>
responseType
,
public
<
T
>
T
patchForObject
(
String
url
,
Object
request
,
Class
<
T
>
responseType
,
Map
<
String
,
?>
uriVariables
)
throws
RestClientException
{
return
this
.
restTemplate
.
patchForObject
(
url
,
request
,
responseType
,
uriVariables
);
}
...
...
@@ -618,10 +618,10 @@ public class TestRestTemplate {
* @param <T> the type of the return value
* @return the converted object
* @throws RestClientException on client-side HTTP error
* @since 1.4.4
* @see HttpEntity
* @since 1.4.3
*/
<
T
>
T
patchForObject
(
URI
url
,
Object
request
,
Class
<
T
>
responseType
)
public
<
T
>
T
patchForObject
(
URI
url
,
Object
request
,
Class
<
T
>
responseType
)
throws
RestClientException
{
return
this
.
restTemplate
.
patchForObject
(
url
,
request
,
responseType
);
...
...
spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java
View file @
ec15607b
...
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
test
.
web
.
client
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.net.URI
;
import
java.util.List
;
...
...
@@ -47,6 +48,7 @@ import static org.mockito.Mockito.mock;
*
* @author Dave Syer
* @author Phillip Webb
* @author Stephane Nicoll
*/
public
class
TestRestTemplateTests
{
...
...
@@ -93,6 +95,9 @@ public class TestRestTemplateTests {
throws
IllegalArgumentException
,
IllegalAccessException
{
Method
equivalent
=
ReflectionUtils
.
findMethod
(
TestRestTemplate
.
class
,
method
.
getName
(),
method
.
getParameterTypes
());
assertThat
(
equivalent
).
as
(
"Method %s not found"
,
method
).
isNotNull
();
assertThat
(
Modifier
.
isPublic
(
equivalent
.
getModifiers
()))
.
as
(
"Method %s should have been public"
,
equivalent
).
isTrue
();
try
{
equivalent
.
invoke
(
restTemplate
,
mockArguments
(
method
.
getParameterTypes
()));
...
...
@@ -129,6 +134,12 @@ public class TestRestTemplateTests {
return
mock
(
type
);
}
},
new
ReflectionUtils
.
MethodFilter
()
{
@Override
public
boolean
matches
(
Method
method
)
{
return
Modifier
.
isPublic
(
method
.
getModifiers
());
}
});
}
...
...
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