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
43e2df10
Commit
43e2df10
authored
Jul 10, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align with latest changes in Spring Data REST
parent
cf3b1f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
22 deletions
+3
-22
RepositoryRestMvcAutoConfigurationTests.java
...re/data/rest/RepositoryRestMvcAutoConfigurationTests.java
+3
-22
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfigurationTests.java
View file @
43e2df10
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
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.
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.data.rest;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.data.rest;
import
java.net.URI
;
import
java.net.URI
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
@@ -40,7 +39,7 @@ import org.springframework.context.annotation.Import;
...
@@ -40,7 +39,7 @@ import org.springframework.context.annotation.Import;
import
org.springframework.data.rest.core.config.RepositoryRestConfiguration
;
import
org.springframework.data.rest.core.config.RepositoryRestConfiguration
;
import
org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy.RepositoryDetectionStrategies
;
import
org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy.RepositoryDetectionStrategies
;
import
org.springframework.data.rest.webmvc.BaseUri
;
import
org.springframework.data.rest.webmvc.BaseUri
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer
Adapter
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration
;
import
org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
import
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
;
...
@@ -146,24 +145,6 @@ public class RepositoryRestMvcAutoConfigurationTests {
...
@@ -146,24 +145,6 @@ public class RepositoryRestMvcAutoConfigurationTests {
assertThat
(
bean
.
getBaseUri
()).
isEqualTo
(
URI
.
create
(
""
));
assertThat
(
bean
.
getBaseUri
()).
isEqualTo
(
URI
.
create
(
""
));
}
}
@Test
public
void
objectMappersAreConfiguredUsingObjectMapperBuilder
()
throws
JsonProcessingException
{
load
(
TestConfigurationWithObjectMapperBuilder
.
class
);
assertThatDateIsFormattedCorrectly
(
"halObjectMapper"
);
assertThatDateIsFormattedCorrectly
(
"objectMapper"
);
}
@Test
public
void
primaryObjectMapperIsAvailable
()
{
load
(
TestConfiguration
.
class
);
Map
<
String
,
ObjectMapper
>
objectMappers
=
this
.
context
.
getBeansOfType
(
ObjectMapper
.
class
);
assertThat
(
objectMappers
.
size
()).
isGreaterThan
(
1
);
this
.
context
.
getBean
(
ObjectMapper
.
class
);
}
public
void
assertThatDateIsFormattedCorrectly
(
String
beanName
)
public
void
assertThatDateIsFormattedCorrectly
(
String
beanName
)
throws
JsonProcessingException
{
throws
JsonProcessingException
{
ObjectMapper
objectMapper
=
this
.
context
.
getBean
(
beanName
,
ObjectMapper
.
class
);
ObjectMapper
objectMapper
=
this
.
context
.
getBean
(
beanName
,
ObjectMapper
.
class
);
...
@@ -221,7 +202,7 @@ public class RepositoryRestMvcAutoConfigurationTests {
...
@@ -221,7 +202,7 @@ public class RepositoryRestMvcAutoConfigurationTests {
}
}
static
class
TestRepositoryRestConfigurer
extends
RepositoryRestConfigurerAdapt
er
{
static
class
TestRepositoryRestConfigurer
implements
RepositoryRestConfigur
er
{
@Override
@Override
public
void
configureRepositoryRestConfiguration
(
public
void
configureRepositoryRestConfiguration
(
...
...
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