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
5777aa56
Commit
5777aa56
authored
Jul 29, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start building against Spring Data 2020.0.0 snapshots
See gh-22647
parent
044408e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
13 deletions
+22
-13
DispatcherServletsMappingDescriptionProvider.java
...servlet/DispatcherServletsMappingDescriptionProvider.java
+8
-7
SpringBootRepositoryRestConfigurer.java
...nfigure/data/rest/SpringBootRepositoryRestConfigurer.java
+8
-1
RepositoryRestMvcAutoConfigurationTests.java
...re/data/rest/RepositoryRestMvcAutoConfigurationTests.java
+5
-4
build.gradle
spring-boot-project/spring-boot-dependencies/build.gradle
+1
-1
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/DispatcherServletsMappingDescriptionProvider.java
View file @
5777aa56
/*
* 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.
...
...
@@ -32,7 +32,6 @@ import org.springframework.boot.actuate.web.mappings.HandlerMethodDescription;
import
org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.data.rest.webmvc.support.DelegatingHandlerMapping
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
...
...
@@ -51,6 +50,7 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMappi
* @author Stephane Nicoll
* @since 2.0.0
*/
@SuppressWarnings
(
"deprecation"
)
public
class
DispatcherServletsMappingDescriptionProvider
implements
MappingDescriptionProvider
{
private
static
final
List
<
HandlerMappingDescriptionProvider
<?
extends
HandlerMapping
>>
descriptionProviders
;
...
...
@@ -171,8 +171,8 @@ public class DispatcherServletsMappingDescriptionProvider implements MappingDesc
}
private
static
final
class
DelegatingHandlerMappingDescriptionProvider
implements
HandlerMappingDescriptionProvider
<
DelegatingHandlerMapping
>
{
private
static
final
class
DelegatingHandlerMappingDescriptionProvider
implements
HandlerMappingDescriptionProvider
<
org
.
springframework
.
data
.
rest
.
webmvc
.
support
.
DelegatingHandlerMapping
>
{
private
final
List
<
HandlerMappingDescriptionProvider
<?>>
descriptionProviders
;
...
...
@@ -182,12 +182,13 @@ public class DispatcherServletsMappingDescriptionProvider implements MappingDesc
}
@Override
public
Class
<
DelegatingHandlerMapping
>
getMappingClass
()
{
return
DelegatingHandlerMapping
.
class
;
public
Class
<
org
.
springframework
.
data
.
rest
.
webmvc
.
support
.
DelegatingHandlerMapping
>
getMappingClass
()
{
return
org
.
springframework
.
data
.
rest
.
webmvc
.
support
.
DelegatingHandlerMapping
.
class
;
}
@Override
public
List
<
DispatcherServletMappingDescription
>
describe
(
DelegatingHandlerMapping
handlerMapping
)
{
public
List
<
DispatcherServletMappingDescription
>
describe
(
org
.
springframework
.
data
.
rest
.
webmvc
.
support
.
DelegatingHandlerMapping
handlerMapping
)
{
List
<
DispatcherServletMappingDescription
>
descriptions
=
new
ArrayList
<>();
for
(
HandlerMapping
delegate
:
handlerMapping
.
getDelegates
())
{
descriptions
.
addAll
(
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/SpringBootRepositoryRestConfigurer.java
View file @
5777aa56
/*
* 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.
...
...
@@ -23,6 +23,7 @@ import org.springframework.core.annotation.Order;
import
org.springframework.data.rest.core.config.RepositoryRestConfiguration
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer
;
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
/**
* A {@code RepositoryRestConfigurer} that applies configuration items from the
...
...
@@ -43,7 +44,13 @@ class SpringBootRepositoryRestConfigurer implements RepositoryRestConfigurer {
private
RepositoryRestProperties
properties
;
@Override
@SuppressWarnings
(
"deprecation"
)
public
void
configureRepositoryRestConfiguration
(
RepositoryRestConfiguration
config
)
{
configureRepositoryRestConfiguration
(
config
,
null
);
}
@Override
public
void
configureRepositoryRestConfiguration
(
RepositoryRestConfiguration
config
,
CorsRegistry
cors
)
{
this
.
properties
.
applyTo
(
config
);
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java
View file @
5777aa56
/*
* 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.
...
...
@@ -42,6 +42,7 @@ import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguratio
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.web.servlet.config.annotation.CorsRegistry
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -76,7 +77,7 @@ class RepositoryRestMvcAutoConfigurationTests {
assertThat
(
this
.
context
.
getBean
(
RepositoryRestMvcConfiguration
.
class
)).
isNotNull
();
RepositoryRestConfiguration
bean
=
this
.
context
.
getBean
(
RepositoryRestConfiguration
.
class
);
URI
expectedUri
=
URI
.
create
(
"/foo"
);
assertThat
(
bean
.
getBase
Uri
()).
as
(
"Custom basePath not set"
).
isEqualTo
(
expectedUri
);
assertThat
(
bean
.
getBase
Path
()).
as
(
"Custom basePath not set"
).
isEqualTo
(
expectedUri
);
BaseUri
baseUri
=
this
.
context
.
getBean
(
BaseUri
.
class
);
assertThat
(
expectedUri
).
as
(
"Custom basePath has not been applied to BaseUri bean"
).
isEqualTo
(
baseUri
.
getUri
());
}
...
...
@@ -119,7 +120,7 @@ class RepositoryRestMvcAutoConfigurationTests {
load
(
TestConfigurationWithRestMvcConfig
.
class
,
"spring.data.rest.base-path:foo"
);
assertThat
(
this
.
context
.
getBean
(
RepositoryRestMvcConfiguration
.
class
)).
isNotNull
();
RepositoryRestConfiguration
bean
=
this
.
context
.
getBean
(
RepositoryRestConfiguration
.
class
);
assertThat
(
bean
.
getBase
Uri
()).
isEqualTo
(
URI
.
create
(
""
));
assertThat
(
bean
.
getBase
Path
()).
isEqualTo
(
URI
.
create
(
""
));
}
private
void
load
(
Class
<?>
config
,
String
...
environment
)
{
...
...
@@ -174,7 +175,7 @@ class RepositoryRestMvcAutoConfigurationTests {
static
class
TestRepositoryRestConfigurer
implements
RepositoryRestConfigurer
{
@Override
public
void
configureRepositoryRestConfiguration
(
RepositoryRestConfiguration
config
)
{
public
void
configureRepositoryRestConfiguration
(
RepositoryRestConfiguration
config
,
CorsRegistry
cors
)
{
config
.
setRepositoryDetectionStrategy
(
RepositoryDetectionStrategies
.
ALL
);
config
.
setDefaultMediaType
(
MediaType
.
parseMediaType
(
"application/my-custom-json"
));
config
.
setMaxPageSize
(
78
);
...
...
spring-boot-project/spring-boot-dependencies/build.gradle
View file @
5777aa56
...
...
@@ -1563,7 +1563,7 @@ bom {
]
}
}
library
(
"Spring Data Bom"
,
"2020.0.0-
M1
"
)
{
library
(
"Spring Data Bom"
,
"2020.0.0-
SNAPSHOT
"
)
{
group
(
"org.springframework.data"
)
{
imports
=
[
"spring-data-bom"
...
...
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