Commit d510bc71 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Polish

Closes gh-14271
parent 7dff13b6
......@@ -669,7 +669,7 @@ public class KafkaProperties {
/**
* Comma-delimited list of host:port pairs to use for establishing the initial
* connection to the Kafka cluster. Overrides the global property, for streams.
* connections to the Kafka cluster. Overrides the global property, for streams.
*/
private List<String> bootstrapServers;
......
......@@ -41,7 +41,7 @@ public class ClientsConfiguredCondition extends SpringBootCondition {
private static final Bindable<Map<String, OAuth2ClientProperties.LoginClientRegistration>> STRING_LOGIN_REGISTRATION_MAP = Bindable
.mapOf(String.class, OAuth2ClientProperties.LoginClientRegistration.class);
private static final Bindable<Map<String, OAuth2ClientProperties.AuthorizationCodeClientRegistration>> STRING_AUTHORIZATIONCODE_REGISTRATION_MAP = Bindable
private static final Bindable<Map<String, OAuth2ClientProperties.AuthorizationCodeClientRegistration>> STRING_AUTHORIZATION_CODE_REGISTRATION_MAP = Bindable
.mapOf(String.class,
OAuth2ClientProperties.AuthorizationCodeClientRegistration.class);
......@@ -71,7 +71,7 @@ public class ClientsConfiguredCondition extends SpringBootCondition {
Map<String, OAuth2ClientProperties.AuthorizationCodeClientRegistration> authCodeClientRegistrations = Binder
.get(environment)
.bind("spring.security.oauth2.client.registration.authorizationcode",
STRING_AUTHORIZATIONCODE_REGISTRATION_MAP)
STRING_AUTHORIZATION_CODE_REGISTRATION_MAP)
.orElse(Collections.emptyMap());
registrations.putAll(loginClientRegistrations);
registrations.putAll(authCodeClientRegistrations);
......
......@@ -307,7 +307,7 @@ public class KafkaAutoConfigurationTests {
Properties configs = context.getBean(
KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME,
KafkaStreamsConfiguration.class).asProperties();
assertThat(configs.get(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG))
assertThat(configs.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG))
.isEqualTo("localhost:9092, localhost:9093");
assertThat(
configs.get(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG))
......@@ -357,7 +357,7 @@ public class KafkaAutoConfigurationTests {
Properties configs = context.getBean(
KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME,
KafkaStreamsConfiguration.class).asProperties();
assertThat(configs.get(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG))
assertThat(configs.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG))
.isEqualTo("localhost:9092, localhost:9093");
assertThat(configs.get(StreamsConfig.APPLICATION_ID_CONFIG))
.isEqualTo("my-test-app");
......@@ -376,7 +376,7 @@ public class KafkaAutoConfigurationTests {
Properties configs = context.getBean(
KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME,
KafkaStreamsConfiguration.class).asProperties();
assertThat(configs.get(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG))
assertThat(configs.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG))
.isEqualTo("localhost:9094, localhost:9095");
assertThat(configs.get(StreamsConfig.APPLICATION_ID_CONFIG))
.isEqualTo("test-id");
......@@ -628,7 +628,7 @@ public class KafkaAutoConfigurationTests {
@Bean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME)
public KafkaStreamsConfiguration kafkaStreamsConfiguration() {
Map<String, Object> streamsProperties = new HashMap<>();
streamsProperties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,
streamsProperties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,
"localhost:9094, localhost:9095");
streamsProperties.put(StreamsConfig.APPLICATION_ID_CONFIG, "test-id");
......
......@@ -236,7 +236,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
}
@Test
public void getClientRegistrationsWhenAuhtorizationCodeClientShouldAdapt() {
public void getClientRegistrationsWhenAuthorizationCodeClientShouldAdapt() {
OAuth2ClientProperties properties = new OAuth2ClientProperties();
OAuth2ClientProperties.AuthorizationCodeClientRegistration registration = new OAuth2ClientProperties.AuthorizationCodeClientRegistration();
registration.setClientId("clientId");
......
......@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -96,25 +95,24 @@ public class BasicErrorControllerIntegrationTests {
@Test
public void testErrorForMachineClientTraceParamTrue() {
errorForMachineClientOnTraceParam(() -> createUrl("?trace=true"), true);
errorForMachineClientOnTraceParam("?trace=true", true);
}
@Test
public void testErrorForMachineClientTraceParamFalse() {
errorForMachineClientOnTraceParam(() -> createUrl("?trace=false"), false);
errorForMachineClientOnTraceParam("?trace=false", false);
}
@Test
public void testErrorForMachineClientTraceParamAbsent() {
errorForMachineClientOnTraceParam(() -> createUrl(""), false);
errorForMachineClientOnTraceParam("", false);
}
@SuppressWarnings("rawtypes")
private void errorForMachineClientOnTraceParam(Supplier<String> url,
boolean expectedTrace) {
private void errorForMachineClientOnTraceParam(String path, boolean expectedTrace) {
load("--server.error.include-exception=true",
"--server.error.include-stacktrace=on-trace-param");
ResponseEntity<Map> entity = new TestRestTemplate().getForEntity(url.get(),
ResponseEntity<Map> entity = new TestRestTemplate().getForEntity(createUrl(path),
Map.class);
assertErrorAttributes(entity.getBody(), "500", "Internal Server Error",
IllegalStateException.class, "Expected!", "/");
......
......@@ -549,7 +549,7 @@ content into your application. Rather, pick only the properties that you need.
spring.flyway.baseline-description= #
spring.flyway.baseline-on-migrate= #
spring.flyway.baseline-version=1 # Version to start migration
spring.flyway.batch = #
spring.flyway.batch= #
spring.flyway.check-location=true # Whether to check that migration scripts location exists.
spring.flyway.clean-disabled= #
spring.flyway.clean-on-validation-error= #
......@@ -1106,9 +1106,9 @@ content into your application. Rather, pick only the properties that you need.
spring.kafka.ssl.trust-store-location= # Location of the trust store file.
spring.kafka.ssl.trust-store-password= # Store password for the trust store file.
spring.kafka.ssl.trust-store-type= # Type of the trust store.
spring.kafka.streams.application-id = # Kafka streams application.id property; default spring.application.name.
spring.kafka.streams.application-id= # Kafka streams application.id property; default spring.application.name.
spring.kafka.streams.auto-startup=true # Whether or not to auto-start the streams factory bean.
spring.kafka.streams.bootstrap-servers= # Comma-delimited list of host:port pairs to use for establishing the initial connection to the Kafka cluster. Overrides the global property, for streams.
spring.kafka.streams.bootstrap-servers= # Comma-delimited list of host:port pairs to use for establishing the initial connections to the Kafka cluster. Overrides the global property, for streams.
spring.kafka.streams.cache-max-bytes-buffering= # Maximum number of memory bytes to be used for buffering across all threads.
spring.kafka.streams.client-id= # ID to pass to the server when making requests. Used for server-side logging.
spring.kafka.streams.properties.*= # Additional Kafka properties used to configure the streams.
......
......@@ -1326,7 +1326,7 @@ source for more details.
[[howto-switch-off-the-spring-mvc-dispatcherservlet]]
=== Switch Off the Spring MVC DispatcherServlet
By default, All content is served from the root of your application (`/`) down. If you
By default, all content is served from the root of your application (`/`). If you
would rather map to a different path, you can configure one as follows:
[source,properties,indent=0,subs="verbatim"]
......
......@@ -5701,12 +5701,12 @@ reference the auto-configured `KafkaTransactionManager` bean.
==== Kafka Streams
Spring for Apache Kafka provides a factory bean to create a `StreamsBuilder` object and
manage the lifecycle of its streams. Spring Boot auto-configures the required
`KafkaStreamsConfiguration` bean as long as `kafka-streams` in on the classpath and kafka
streams is enabled via the `@EnableKafkaStreams` annotation.
`KafkaStreamsConfiguration` bean as long as `kafka-streams` is on the classpath and Kafka
Streams is enabled via the `@EnableKafkaStreams` annotation.
Enabling Kafka Streams means that the application id and bootstrap servers must be set.
The former can be configured using `spring.kafka.streams.application-id`, defaulting to
`spring.application.name` if not set. The later can be set globally or
`spring.application.name` if not set. The latter can be set globally or
specifically overridden just for streams.
Several additional properties are available using dedicated properties; other arbitrary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment