Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and mhalbritter committed Nov 22, 2023
1 parent 9c43ed7 commit 175b647
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.util.ReflectionTestUtils;

import static org.assertj.core.api.Assertions.as;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -129,8 +128,7 @@ void shouldApplyTokenTypeWavefrontApiToken() {
"management.wavefront.api-token=abcde")
.run((context) -> {
WavefrontSender sender = context.getBean(WavefrontSender.class);
Object tokenService = ReflectionTestUtils.getField(sender, "tokenService");
assertThat(tokenService).isInstanceOf(WavefrontTokenService.class);
assertThat(sender).extracting("tokenService").isInstanceOf(WavefrontTokenService.class);
});
}

Expand All @@ -141,8 +139,7 @@ void shouldApplyTokenTypeCspApiToken() {
"management.wavefront.api-token=abcde")
.run((context) -> {
WavefrontSender sender = context.getBean(WavefrontSender.class);
Object tokenService = ReflectionTestUtils.getField(sender, "tokenService");
assertThat(tokenService).isInstanceOf(CSPTokenService.class);
assertThat(sender).extracting("tokenService").isInstanceOf(CSPTokenService.class);
});
}

Expand All @@ -153,17 +150,15 @@ void shouldApplyTokenTypeCspClientCredentials() {
"management.wavefront.api-token=clientid=cid,clientsecret=csec")
.run((context) -> {
WavefrontSender sender = context.getBean(WavefrontSender.class);
Object tokenService = ReflectionTestUtils.getField(sender, "tokenService");
assertThat(tokenService).isInstanceOf(CSPTokenService.class);
assertThat(sender).extracting("tokenService").isInstanceOf(CSPTokenService.class);
});
}

@Test
void shouldApplyTokenTypeNoToken() {
this.contextRunner.withPropertyValues("management.wavefront.api-token-type=NO_TOKEN").run((context) -> {
WavefrontSender sender = context.getBean(WavefrontSender.class);
Object tokenService = ReflectionTestUtils.getField(sender, "tokenService");
assertThat(tokenService).isInstanceOf(NoopProxyTokenService.class);
assertThat(sender).extracting("tokenService").isInstanceOf(NoopProxyTokenService.class);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void smtpOnDefaultHostAndPortIsDown() throws MessagingException {
assertThat(health.getDetails()).doesNotContainKey("location");
Object errorMessage = health.getDetails().get("error");
assertThat(errorMessage).isNotNull();
assertThat(errorMessage.toString().contains("A test exception")).isTrue();
assertThat(errorMessage.toString()).contains("A test exception");
}

@Test
Expand All @@ -104,7 +104,7 @@ void smtpOnDefaultHostAndCustomPortIsDown() throws MessagingException {
assertThat(health.getDetails().get("location")).isEqualTo(":1234");
Object errorMessage = health.getDetails().get("error");
assertThat(errorMessage).isNotNull();
assertThat(errorMessage.toString().contains("A test exception")).isTrue();
assertThat(errorMessage.toString()).contains("A test exception");
}

@Test
Expand All @@ -125,7 +125,7 @@ void smtpOnDefaultPortIsDown() throws MessagingException {
assertThat(health.getDetails()).containsEntry("location", "smtp.acme.org");
Object errorMessage = health.getDetails().get("error");
assertThat(errorMessage).isNotNull();
assertThat(errorMessage.toString().contains("A test exception")).isTrue();
assertThat(errorMessage.toString()).contains("A test exception");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
org.springframework.boot.autoconfigure.pulsar.PulsarAutoConfiguration
org.springframework.boot.autoconfigure.pulsar.PulsarReactiveAutoConfiguration
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration
org.springframework.boot.autoconfigure.r2dbc.R2dbcTransactionManagerAutoConfiguration
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void enableEnumFeature() {

@Test
void disableJsonNodeFeature() {
this.contextRunner.withPropertyValues("spring.jackson.datatype.jsonnode.write-null-properties:false")
this.contextRunner.withPropertyValues("spring.jackson.datatype.json-node.write-null-properties:false")
.run((context) -> {
ObjectMapper mapper = context.getBean(ObjectMapper.class);
assertThat(JsonNodeFeature.WRITE_NULL_PROPERTIES.enabledByDefault()).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void restTemplateBuilderConfigurerShouldBeLazilyDefined() {

@Test
void shouldFailOnCustomRestTemplateBuilderConfigurer() {
this.contextRunner.withUserConfiguration(RestTemplateCustomConfigurerConfig.class)
this.contextRunner.withUserConfiguration(RestTemplateBuilderConfigurerConfig.class)
.run((context) -> assertThat(context).getFailure()
.isInstanceOf(BeanDefinitionOverrideException.class)
.hasMessageContaining("with name 'restTemplateBuilderConfigurer'"));
Expand Down Expand Up @@ -273,7 +273,7 @@ RestTemplateRequestCustomizer<?> restTemplateRequestCustomizer() {
}

@Configuration(proxyBeanMethods = false)
static class RestTemplateCustomConfigurerConfig {
static class RestTemplateBuilderConfigurerConfig {

@Bean
RestTemplateBuilderConfigurer restTemplateBuilderConfigurer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ With this Docker Compose file in place, the JDBC URL used is `jdbc:postgresql://
If you want to share services between multiple applications, create the `compose.yaml` file in one of the applications and then use the configuration property configprop:spring.docker.compose.file[] in the other applications to reference the `compose.yaml` file.
You should also set configprop:spring.docker.compose.lifecycle-management[] to `start-only`, as it defaults to `start-and-stop` and stopping one application would shut down the shared services for the other still running applications, too.
Setting it to `start-only` won't stop the shared services on application stop, but a caveat is that if you shut down all applications, the services stay running.
You can stop the services manually by running `docker compose stop` on the commandline in the directory which contains the `compose.yaml` file.
You can stop the services manually by running `docker compose stop` on the command line in the directory which contains the `compose.yaml` file.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ These features are described in several enums (in Jackson) that map onto propert
| `true`, `false`

| `com.fasterxml.jackson.databind.cfg.JsonNodeFeature`
| `spring.jackson.datatype.jsonnode.<feature_name>`
| `spring.jackson.datatype.json-node.<feature_name>`
| `true`, `false`

| `com.fasterxml.jackson.databind.DeserializationFeature`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have Spring WebFlux on your classpath we recommend that you use `WebClien
The `WebClient` interface provides a functional style API and is fully reactive.
You can learn more about the `WebClient` in the dedicated {spring-framework-docs}/web/webflux-webclient.html[section in the Spring Framework docs].

TIP: If you are not writing a reactive Spring WebFlux application you can use the a <<io#io.rest-client.restclient,`RestClient`>> instead of a `WebClient`.
TIP: If you are not writing a reactive Spring WebFlux application you can use the <<io#io.rest-client.restclient,`RestClient`>> instead of a `WebClient`.
This provides a similar functional API, but is blocking rather than reactive.

Spring Boot creates and pre-configures a prototype `WebClient.Builder` bean for you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Usually, you would define the properties in your `application.properties` or `ap

Common server settings include:

* Network settings: Listen port for incoming HTTP requests (`server.port`), interface address to bind to `server.address`, and so on.
* Network settings: Listen port for incoming HTTP requests (`server.port`), interface address to bind to (`server.address`), and so on.
* Error management: Location of the error page (`server.error.path`) and so on.
* <<howto#howto.webserver.configure-ssl,SSL>>
* <<howto#howto.webserver.enable-response-compression,HTTP compression>>
Expand All @@ -291,7 +291,7 @@ The following example shows programmatically setting the port:

include::code:MyWebServerFactoryCustomizer[]

`JettyReactiveWebServerFactory`, `NettyReactiveWebServerFactory`, `TomcatReactiveWebServerFactory`, and `UndertowServletWebServerFactory` are dedicated variants of `ConfigurableReactiveWebServerFactory` that have additional customization setter methods for Jetty, Reactor Netty, Tomcat, and Undertow respectively.
`JettyReactiveWebServerFactory`, `NettyReactiveWebServerFactory`, `TomcatReactiveWebServerFactory`, and `UndertowReactiveWebServerFactory` are dedicated variants of `ConfigurableReactiveWebServerFactory` that have additional customization setter methods for Jetty, Reactor Netty, Tomcat, and Undertow respectively.
The following example shows how to customize `NettyReactiveWebServerFactory` that provides access to Reactor Netty-specific configuration options:

include::code:MyNettyWebServerFactoryCustomizer[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Usually, you would define the properties in your `application.properties` or `ap

Common server settings include:

* Network settings: Listen port for incoming HTTP requests (`server.port`), interface address to bind to `server.address`, and so on.
* Network settings: Listen port for incoming HTTP requests (`server.port`), interface address to bind to (`server.address`), and so on.
* Session settings: Whether the session is persistent (`server.servlet.session.persistent`), session timeout (`server.servlet.session.timeout`), location of session data (`server.servlet.session.store-dir`), and session-cookie configuration (`server.servlet.session.cookie.*`).
* Error management: Location of the error page (`server.error.path`) and so on.
* <<howto#howto.webserver.configure-ssl,SSL>>
Expand Down
4 changes: 2 additions & 2 deletions spring-boot-project/spring-boot-parent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bom {
library("C3P0", "0.9.5.5") {
group("com.mchange") {
modules = [
"c3p0"
"c3p0"
]
}
}
Expand Down Expand Up @@ -141,7 +141,7 @@ bom {
library("Micrometer Context Propagation", "1.0.5") {
group("io.micrometer") {
modules = [
"context-propagation"
"context-propagation"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,4 @@ public void destroy() {

}

static record RegisteredFilter(Filter filter, Map<String, String> initParameters,
EnumSet<DispatcherType> dispatcherTypes) {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
* contains. Unlike {@link java.util.zip.ZipFile}, this implementation can load content
* from a zip file nested inside another file as long as the entry is not compressed.
* <p>
* In order to reduce memory consumption, this implementation stores only the the hash of
* the entry names, the central directory offsets and the original positions. Entries are
* In order to reduce memory consumption, this implementation stores only the hash of the
* entry names, the central directory offsets and the original positions. Entries are
* stored internally in {@code hashCode} order so that a binary search can be used to
* quickly find an entry by name or determine if the zip file doesn't have a given entry.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,8 @@ public boolean isKeepAlive() {
}

/**
* Whether to keep the application alive even if there are no more non-daemon threads.
* Set whether to keep the application alive even if there are no more non-daemon
* threads.
* @param keepAlive whether to keep the application alive even if there are no more
* non-daemon threads
* @since 3.2.0
Expand Down

0 comments on commit 175b647

Please sign in to comment.