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
5fc01880
Commit
5fc01880
authored
Sep 07, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
c46d513a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
ElasticsearchDataAutoConfigurationTests.java
...lasticsearch/ElasticsearchDataAutoConfigurationTests.java
+15
-22
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java
View file @
5fc01880
...
@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Artur Konczak
* @author Artur Konczak
* @author Stephane Nicoll
*/
*/
public
class
ElasticsearchDataAutoConfigurationTests
{
public
class
ElasticsearchDataAutoConfigurationTests
{
...
@@ -47,45 +48,37 @@ public class ElasticsearchDataAutoConfigurationTests {
...
@@ -47,45 +48,37 @@ public class ElasticsearchDataAutoConfigurationTests {
@Test
@Test
public
void
templateExists
()
{
public
void
templateExists
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
load
(
"spring.data.elasticsearch.properties.path.data:target/data"
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.data.elasticsearch.properties.path.data:target/data"
,
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
this
.
context
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBeanNamesForType
(
ElasticsearchTemplate
.
class
))
assertThat
(
this
.
context
.
getBeanNamesForType
(
ElasticsearchTemplate
.
class
))
.
hasSize
(
1
);
.
hasSize
(
1
);
}
}
@Test
@Test
public
void
mappingContextExists
()
{
public
void
mappingContextExists
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
load
(
"spring.data.elasticsearch.properties.path.data:target/data"
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.data.elasticsearch.properties.path.data:target/data"
,
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
this
.
context
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
assertThat
(
this
.
context
.
getBeanNamesForType
(
SimpleElasticsearchMappingContext
.
class
))
this
.
context
.
getBeanNamesForType
(
SimpleElasticsearchMappingContext
.
class
))
.
hasSize
(
1
);
.
hasSize
(
1
);
}
}
@Test
@Test
public
void
converterExists
()
{
public
void
converterExists
()
{
this
.
context
=
new
AnnotationConfigApplicationContext
();
load
(
"spring.data.elasticsearch.properties.path.data:target/data"
,
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"spring.data.elasticsearch.properties.path.data:target/data"
,
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
"spring.data.elasticsearch.properties.path.logs:target/logs"
);
this
.
context
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
);
this
.
context
.
refresh
();
assertThat
(
this
.
context
.
getBeanNamesForType
(
ElasticsearchConverter
.
class
))
assertThat
(
this
.
context
.
getBeanNamesForType
(
ElasticsearchConverter
.
class
))
.
hasSize
(
1
);
.
hasSize
(
1
);
}
}
private
void
load
(
String
...
environment
)
{
AnnotationConfigApplicationContext
ctx
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
ctx
,
environment
);
ctx
.
register
(
PropertyPlaceholderAutoConfiguration
.
class
,
ElasticsearchAutoConfiguration
.
class
,
ElasticsearchDataAutoConfiguration
.
class
);
ctx
.
refresh
();
this
.
context
=
ctx
;
}
}
}
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