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
2ad234b6
Commit
2ad234b6
authored
Feb 28, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to breaking change in Spring Hateoas
parent
ad6e58e4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
28 deletions
+28
-28
HypermediaAutoConfiguration.java
...ot/autoconfigure/hateoas/HypermediaAutoConfiguration.java
+5
-5
HypermediaHttpMessageConverterConfiguration.java
.../hateoas/HypermediaHttpMessageConverterConfiguration.java
+2
-2
HttpMessageConverters.java
...mework/boot/autoconfigure/http/HttpMessageConverters.java
+2
-2
JacksonHttpMessageConvertersConfiguration.java
...igure/http/JacksonHttpMessageConvertersConfiguration.java
+2
-2
HypermediaAutoConfigurationTests.java
...toconfigure/hateoas/HypermediaAutoConfigurationTests.java
+5
-5
HttpMessageConvertersAutoConfigurationTests.java
...ure/http/HttpMessageConvertersAutoConfigurationTests.java
+3
-3
HateoasObjenesisCacheDisabler.java
...devtools/autoconfigure/HateoasObjenesisCacheDisabler.java
+2
-2
HateoasObjenesisCacheDisablerTests.java
...ols/autoconfigure/HateoasObjenesisCacheDisablerTests.java
+2
-2
RestDocsTestController.java
...t/test/autoconfigure/restdocs/RestDocsTestController.java
+1
-1
HateoasController.java
.../autoconfigure/web/servlet/mockmvc/HateoasController.java
+4
-4
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfiguration.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,12 +30,12 @@ import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguratio
...
@@ -30,12 +30,12 @@ import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguratio
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.hateoas.EntityLinks
;
import
org.springframework.hateoas.EntityModel
;
import
org.springframework.hateoas.LinkDiscoverers
;
import
org.springframework.hateoas.client.LinkDiscoverers
;
import
org.springframework.hateoas.Resource
;
import
org.springframework.hateoas.config.EnableEntityLinks
;
import
org.springframework.hateoas.config.EnableEntityLinks
;
import
org.springframework.hateoas.config.EnableHypermediaSupport
;
import
org.springframework.hateoas.config.EnableHypermediaSupport
;
import
org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType
;
import
org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType
;
import
org.springframework.hateoas.server.EntityLinks
;
import
org.springframework.plugin.core.Plugin
;
import
org.springframework.plugin.core.Plugin
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -49,7 +49,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -49,7 +49,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @since 1.1.0
* @since 1.1.0
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
({
Resource
.
class
,
RequestMapping
.
class
,
Plugin
.
class
})
@ConditionalOnClass
({
EntityModel
.
class
,
RequestMapping
.
class
,
Plugin
.
class
})
@ConditionalOnWebApplication
@ConditionalOnWebApplication
@AutoConfigureAfter
({
WebMvcAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
@AutoConfigureAfter
({
WebMvcAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hateoas/HypermediaHttpMessageConverterConfiguration.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,7 +30,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
...
@@ -30,7 +30,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.hateoas.
server.
mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.AbstractHttpMessageConverter
;
import
org.springframework.http.converter.AbstractHttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConverters.java
View file @
2ad234b6
...
@@ -60,8 +60,8 @@ public class HttpMessageConverters implements Iterable<HttpMessageConverter<?>>
...
@@ -60,8 +60,8 @@ public class HttpMessageConverters implements Iterable<HttpMessageConverter<?>>
static
{
static
{
List
<
Class
<?>>
nonReplacingConverters
=
new
ArrayList
<>();
List
<
Class
<?>>
nonReplacingConverters
=
new
ArrayList
<>();
addClassIfExists
(
nonReplacingConverters
,
"org.springframework.hateoas.mvc."
addClassIfExists
(
nonReplacingConverters
,
+
"
TypeConstrainedMappingJackson2HttpMessageConverter"
);
"org.springframework.hateoas.server.mvc.
TypeConstrainedMappingJackson2HttpMessageConverter"
);
NON_REPLACING_CONVERTERS
=
Collections
.
unmodifiableList
(
nonReplacingConverters
);
NON_REPLACING_CONVERTERS
=
Collections
.
unmodifiableList
(
nonReplacingConverters
);
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/JacksonHttpMessageConvertersConfiguration.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -46,7 +46,7 @@ class JacksonHttpMessageConvertersConfiguration {
...
@@ -46,7 +46,7 @@ class JacksonHttpMessageConvertersConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
(
value
=
MappingJackson2HttpMessageConverter
.
class
,
ignoredType
=
{
@ConditionalOnMissingBean
(
value
=
MappingJackson2HttpMessageConverter
.
class
,
ignoredType
=
{
"org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter"
,
"org.springframework.hateoas.
server.
mvc.TypeConstrainedMappingJackson2HttpMessageConverter"
,
"org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter"
})
"org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter"
})
public
MappingJackson2HttpMessageConverter
mappingJackson2HttpMessageConverter
(
public
MappingJackson2HttpMessageConverter
mappingJackson2HttpMessageConverter
(
ObjectMapper
objectMapper
)
{
ObjectMapper
objectMapper
)
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java
View file @
2ad234b6
...
@@ -29,14 +29,14 @@ import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
...
@@ -29,14 +29,14 @@ import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.hateoas.EntityLinks
;
import
org.springframework.hateoas.LinkDiscoverer
;
import
org.springframework.hateoas.LinkDiscoverers
;
import
org.springframework.hateoas.MediaTypes
;
import
org.springframework.hateoas.MediaTypes
;
import
org.springframework.hateoas.client.LinkDiscoverer
;
import
org.springframework.hateoas.client.LinkDiscoverers
;
import
org.springframework.hateoas.config.EnableHypermediaSupport
;
import
org.springframework.hateoas.config.EnableHypermediaSupport
;
import
org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType
;
import
org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType
;
import
org.springframework.hateoas.hal.HalLinkDiscoverer
;
import
org.springframework.hateoas.mediatype.hal.HalLinkDiscoverer
;
import
org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.hateoas.server.EntityLinks
;
import
org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.mock.web.MockServletContext
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java
View file @
2ad234b6
...
@@ -38,8 +38,8 @@ import org.springframework.context.annotation.Bean;
...
@@ -38,8 +38,8 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.support.GenericApplicationContext
;
import
org.springframework.context.support.GenericApplicationContext
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration
;
import
org.springframework.hateoas.Re
sourceSupport
;
import
org.springframework.hateoas.Re
presentationModel
;
import
org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.hateoas.
server.
mvc.TypeConstrainedMappingJackson2HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.StringHttpMessageConverter
;
import
org.springframework.http.converter.StringHttpMessageConverter
;
import
org.springframework.http.converter.json.GsonHttpMessageConverter
;
import
org.springframework.http.converter.json.GsonHttpMessageConverter
;
...
@@ -384,7 +384,7 @@ public class HttpMessageConvertersAutoConfigurationTests {
...
@@ -384,7 +384,7 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Bean
@Bean
public
TypeConstrainedMappingJackson2HttpMessageConverter
typeConstrainedConverter
()
{
public
TypeConstrainedMappingJackson2HttpMessageConverter
typeConstrainedConverter
()
{
return
new
TypeConstrainedMappingJackson2HttpMessageConverter
(
return
new
TypeConstrainedMappingJackson2HttpMessageConverter
(
Re
sourceSupport
.
class
);
Re
presentationModel
.
class
);
}
}
}
}
...
...
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/HateoasObjenesisCacheDisabler.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -56,7 +56,7 @@ class HateoasObjenesisCacheDisabler implements InitializingBean {
...
@@ -56,7 +56,7 @@ class HateoasObjenesisCacheDisabler implements InitializingBean {
private
void
doDisableCaching
()
{
private
void
doDisableCaching
()
{
try
{
try
{
Class
<?>
type
=
ClassUtils
.
forName
(
Class
<?>
type
=
ClassUtils
.
forName
(
"org.springframework.hateoas.core.DummyInvocationUtils"
,
"org.springframework.hateoas.
server.
core.DummyInvocationUtils"
,
getClass
().
getClassLoader
());
getClass
().
getClassLoader
());
removeObjenesisCache
(
type
);
removeObjenesisCache
(
type
);
}
}
...
...
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/HateoasObjenesisCacheDisablerTests.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -22,7 +22,7 @@ import org.junit.After;
...
@@ -22,7 +22,7 @@ import org.junit.After;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.hateoas.core.DummyInvocationUtils
;
import
org.springframework.hateoas.
server.
core.DummyInvocationUtils
;
import
org.springframework.objenesis.ObjenesisStd
;
import
org.springframework.objenesis.ObjenesisStd
;
import
org.springframework.objenesis.instantiator.ObjectInstantiator
;
import
org.springframework.objenesis.instantiator.ObjectInstantiator
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.test.util.ReflectionTestUtils
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsTestController.java
View file @
2ad234b6
...
@@ -20,7 +20,7 @@ import java.util.HashMap;
...
@@ -20,7 +20,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.hateoas.MediaTypes
;
import
org.springframework.hateoas.MediaTypes
;
import
org.springframework.hateoas.mvc.WebMvcLinkBuilder
;
import
org.springframework.hateoas.
server.
mvc.WebMvcLinkBuilder
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java
View file @
2ad234b6
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -19,8 +19,8 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc;
...
@@ -19,8 +19,8 @@ package org.springframework.boot.test.autoconfigure.web.servlet.mockmvc;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.hateoas.EntityModel
;
import
org.springframework.hateoas.Link
;
import
org.springframework.hateoas.Link
;
import
org.springframework.hateoas.Resource
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -34,8 +34,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -34,8 +34,8 @@ import org.springframework.web.bind.annotation.RestController;
class
HateoasController
{
class
HateoasController
{
@RequestMapping
(
"/resource"
)
@RequestMapping
(
"/resource"
)
public
Resource
<
Map
<
String
,
String
>>
resource
()
{
public
EntityModel
<
Map
<
String
,
String
>>
resource
()
{
return
new
Resource
<>(
new
HashMap
<>(),
return
new
EntityModel
<>(
new
HashMap
<>(),
new
Link
(
"self"
,
"http://api.example.com"
));
new
Link
(
"self"
,
"http://api.example.com"
));
}
}
...
...
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