commit
4670226a3c
|
|
@ -32,7 +32,7 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Actual ElasticSearch health indicator configurations imported by
|
||||
* Actual Elasticsearch health indicator configurations imported by
|
||||
* {@link HealthIndicatorAutoConfiguration}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ public class HealthIndicatorAutoConfigurationTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void notElasticSearchHealthIndicator() {
|
||||
public void notElasticsearchHealthIndicator() {
|
||||
EnvironmentTestUtils.addEnvironment(this.context,
|
||||
"management.health.elasticsearch.enabled:false",
|
||||
"spring.data.elasticsearch.properties.path.home:target",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||
public class JestProperties {
|
||||
|
||||
/**
|
||||
* Comma-separated list of the elasticsearch instances to use.
|
||||
* Comma-separated list of the Elasticsearch instances to use.
|
||||
*/
|
||||
private List<String> uris = Collections.singletonList("http://localhost:9200");
|
||||
|
||||
|
|
|
|||
|
|
@ -629,11 +629,11 @@ content into your application; rather pick only the properties that you need.
|
|||
spring.datasource.url= # JDBC url of the database.
|
||||
spring.datasource.username=
|
||||
|
||||
# JEST (ElasticSearch HTTP client) ({sc-spring-boot-autoconfigure}/jest/JestProperties.{sc-ext}[JestProperties])
|
||||
# JEST (Elasticsearch HTTP client) ({sc-spring-boot-autoconfigure}/jest/JestProperties.{sc-ext}[JestProperties])
|
||||
spring.elasticsearch.jest.connection-timeout=3000 # Connection timeout in milliseconds.
|
||||
spring.elasticsearch.jest.password= # Login password.
|
||||
spring.elasticsearch.jest.read-timeout=3000 # Read timeout in milliseconds.
|
||||
spring.elasticsearch.jest.uris=http://localhost:9200 # Comma-separated list of the elasticsearch instances to use.
|
||||
spring.elasticsearch.jest.uris=http://localhost:9200 # Comma-separated list of the Elasticsearch instances to use.
|
||||
spring.elasticsearch.jest.username= # Login user.
|
||||
|
||||
# H2 Web Console ({sc-spring-boot-autoconfigure}/h2/H2ConsoleProperties.{sc-ext}[H2ConsoleProperties])
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ The following `HealthIndicators` are auto-configured by Spring Boot when appropr
|
|||
|Checks that a connection to `DataSource` can be obtained.
|
||||
|
||||
|{sc-spring-boot-actuator}/health/ElasticsearchHealthIndicator.{sc-ext}[`ElasticsearchHealthIndicator`]
|
||||
|Checks that an ElasticSearch cluster is up.
|
||||
|Checks that an Elasticsearch cluster is up.
|
||||
|
||||
|{sc-spring-boot-actuator}/health/JmsHealthIndicator.{sc-ext}[`JmsHealthIndicator`]
|
||||
|Checks that a JMS broker is up.
|
||||
|
|
|
|||
|
|
@ -3335,7 +3335,7 @@ https://github.com/searchbox-io/Jest[Jest].
|
|||
|
||||
|
||||
[[boot-features-connecting-to-elasticsearch-jest]]
|
||||
==== Connecting to Elasticsearch using Spring Data
|
||||
==== Connecting to Elasticsearch using Jest
|
||||
If you have `Jest` on the classpath, you can inject an auto-configured `JestClient`
|
||||
targeting `http://localhost:9200` by default. You can further tune how the client is
|
||||
configured:
|
||||
|
|
@ -3352,14 +3352,13 @@ To take full control over the registration, define a `JestClient` bean.
|
|||
|
||||
|
||||
|
||||
[[boot-features-connecting-to-elasticsearch]]
|
||||
[[boot-features-connecting-to-elasticsearch-spring-data]]
|
||||
==== Connecting to Elasticsearch using Spring Data
|
||||
You can inject an auto-configured `ElasticsearchTemplate` or Elasticsearch `Client`
|
||||
instance as you would any other Spring Bean. By default the instance will embed a
|
||||
local in-memory server (a `Node` in ElasticSearch terms) and use the current working
|
||||
local in-memory server (a `Node` in Elasticsearch terms) and use the current working
|
||||
directory as the home directory for the server. In this setup, the first thing to do
|
||||
is to tell ElasticSearch where to store its files:
|
||||
is to tell Elasticsearch where to store its files:
|
||||
|
||||
[source,properties,indent=0]
|
||||
----
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.springframework.web.client.RestTemplate;
|
|||
import org.springframework.web.util.UriTemplateHandler;
|
||||
|
||||
/**
|
||||
* {@link RequestExpectationManager} that strips any the specified root URI from the
|
||||
* {@link RequestExpectationManager} that strips the specified root URI from the
|
||||
* request before verification. Can be used to simply test declarations when all REST
|
||||
* calls start the same way. For example: <pre class="code">
|
||||
* RestTemplate restTemplate = new RestTemplateBuilder().rootUri("http://example.com").build();
|
||||
|
|
@ -107,7 +107,7 @@ public class RootUriRequestExpectationManager implements RequestExpectationManag
|
|||
/**
|
||||
* Return a bound {@link MockRestServiceServer} for the given {@link RestTemplate},
|
||||
* configured with {@link RootUriRequestExpectationManager} when possible.
|
||||
* @param restTemplate the source reset template
|
||||
* @param restTemplate the source REST template
|
||||
* @return a configured {@link MockRestServiceServer}
|
||||
*/
|
||||
public static MockRestServiceServer bindTo(RestTemplate restTemplate) {
|
||||
|
|
@ -117,7 +117,7 @@ public class RootUriRequestExpectationManager implements RequestExpectationManag
|
|||
/**
|
||||
* Return a bound {@link MockRestServiceServer} for the given {@link RestTemplate},
|
||||
* configured with {@link RootUriRequestExpectationManager} when possible.
|
||||
* @param restTemplate the source reset template
|
||||
* @param restTemplate the source REST template
|
||||
* @param expectationManager the source {@link RequestExpectationManager}
|
||||
* @return a configured {@link MockRestServiceServer}
|
||||
*/
|
||||
|
|
@ -132,7 +132,7 @@ public class RootUriRequestExpectationManager implements RequestExpectationManag
|
|||
* {@link RestTemplate}. If the {@link RestTemplate} is using a
|
||||
* {@link RootUriTemplateHandler} then a {@link RootUriRequestExpectationManager} is
|
||||
* returned, otherwise the source manager is returned unchanged.
|
||||
* @param restTemplate the source reset template
|
||||
* @param restTemplate the source REST template
|
||||
* @param expectationManager the source {@link RequestExpectationManager}
|
||||
* @return a {@link RequestExpectationManager} to be bound to the template
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public class RootUriRequestExpectationManagerTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void bindToShouldReturnMockResetServiceServer() throws Exception {
|
||||
public void bindToShouldReturnMockRestServiceServer() throws Exception {
|
||||
RestTemplate restTemplate = new RestTemplateBuilder().build();
|
||||
MockRestServiceServer bound = RootUriRequestExpectationManager
|
||||
.bindTo(restTemplate);
|
||||
|
|
@ -142,7 +142,7 @@ public class RootUriRequestExpectationManagerTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void bindToWithExpectationManagerShouldReturnMockResetServiceServer()
|
||||
public void bindToWithExpectationManagerShouldReturnMockRestServiceServer()
|
||||
throws Exception {
|
||||
RestTemplate restTemplate = new RestTemplateBuilder().build();
|
||||
MockRestServiceServer bound = RootUriRequestExpectationManager
|
||||
|
|
@ -161,7 +161,7 @@ public class RootUriRequestExpectationManagerTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void forRestTemplateWhenNotUsingRootUriTemplateHandlerShouldReturnOriginalUriRequestExpectationManager()
|
||||
public void forRestTemplateWhenNotUsingRootUriTemplateHandlerShouldReturnOriginalRequestExpectationManager()
|
||||
throws Exception {
|
||||
RestTemplate restTemplate = new RestTemplateBuilder().build();
|
||||
RequestExpectationManager actual = RootUriRequestExpectationManager
|
||||
|
|
|
|||
Loading…
Reference in New Issue