1248 Commits

Author SHA1 Message Date
Andy Wilkinson
82fd4ce9b9 Fix empty context path warning when using Jetty with WebFlux
Previously, the context path was set to an empty string. The led to
Jetty logging a warning about an empty context path and then using
/ instead.

This commit avoids the warning while leaving the context path's end
result unchanged by setting the context path to /.

Closes gh-17399
2019-07-02 17:24:34 +01:00
Andy Wilkinson
73cf11535d Ensure that logging system tests do not leave log files open
See gh-17107
2019-07-02 16:03:30 +01:00
Phillip Webb
07acc4af08 Consistently coerce booleans to enums
Rename `StringToEnumIgnoringCaseConverterFactory` to
`LenientStringToEnumConverterFactory` and extended it to support
binding of YAML style 'true'/'false' values to 'ON'/'OFF'.

Closes gh-17385
2019-07-01 22:55:18 -07:00
Phillip Webb
46b250549d Merge branch '2.1.x'
Closes gh-17396
2019-07-01 21:52:20 -07:00
Phillip Webb
206ba2ad86 Append chars not ints in getLettersAndDigits
Update `StringToEnumIgnoringCaseConverterFactory` so that the
`getLettersAndDigits` method correctly appends `char` elements
rather than `int` elements.

Closes gh-17327
2019-07-01 21:49:29 -07:00
Phillip Webb
c94a7dfa04 Allow binding to package private methods
Closes gh-17394
2019-07-01 18:44:35 -07:00
dreis2211
15d4764185 Avoid bindable properties check when target has null value
See gh-16447
2019-07-01 17:11:58 +01:00
陈其苗
f86cfff77f Remove redundant invocation of getActiveProfiles
See gh-17271
2019-07-01 17:06:12 +01:00
Andy Wilkinson
df5d23ff6c Polish "Migrate LogbackLoggingSystemTests to JUnit 5"
See gh-17107
2019-06-29 23:20:47 +01:00
Ilya Lukyanovich
569830cdca Migrate LogbackLoggingSystemTests to JUnit 5
See gh-17107
2019-06-29 23:20:40 +01:00
Dmytro Nosan
011fea137e Allow multiple values to be specified when configuring a default header
See gh-17286
2019-06-29 23:06:39 +01:00
Andy Wilkinson
71b09e39ae Merge branch '2.1.x'
Closes gh-17370
2019-06-29 22:36:14 +01:00
Dmytro Nosan
ae184874e9 Polish WebServiceTemplateBuilder
See gh-17289
2019-06-29 22:19:03 +01:00
Andy Wilkinson
13bbfb7ede Polish "Polish TomcatReactiveWebServerFactoryTests"
See gh-17336
2019-06-29 21:57:55 +01:00
Johnny Lim
0e7824cec1 Polish TomcatReactiveWebServerFactoryTests
See gh-17336
2019-06-29 21:56:19 +01:00
Andy Wilkinson
e496203740 Merge branch '2.1.x'
Closes gh-17368
2019-06-29 21:19:13 +01:00
Johnny Lim
408035fb3f Remove System.out.println() in a test
See gh-17358
2019-06-29 21:18:44 +01:00
Andy Wilkinson
ea7443bf01 Merge branch '2.1.x'
Closes gh-17367
2019-06-29 21:15:29 +01:00
Johnny Lim
8dea74a2e9 Add a missing quote in DebugLogbackConfigurator
See gh-17357
2019-06-29 21:14:42 +01:00
Phillip Webb
605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb
92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb
cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Phillip Webb
a417e136a3 Merge branch '2.1.x' 2019-06-28 14:15:17 -07:00
Phillip Webb
9aa4887376 Merge branch '2.0.x' into 2.1.x 2019-06-28 14:14:52 -07:00
Phillip Webb
ed3e1e076d Fix AbstractFilterRegistrationBean merge error
Merging 1.5.x accidentally broke `AbstractFilterRegistrationBean`
2019-06-28 14:13:59 -07:00
Phillip Webb
c62b6b4ccd Merge branch '2.1.x' 2019-06-28 12:22:45 -07:00
Phillip Webb
de35efd1ef Merge branch '2.0.x' into 2.1.x 2019-06-28 12:21:57 -07:00
Phillip Webb
bb34846630 Merge branch '1.5.x' into 2.0.x 2019-06-28 12:19:46 -07:00
Andy Wilkinson
66f1344f7c Merge branch '2.1.x'
Closes gh-17335
Closes gh-17292
2019-06-27 12:00:34 +01:00
HaiTao Zhang
d9048d2531 Provide ability to add additional connectors on reactive Tomcat
See gh-17323
2019-06-26 15:36:12 -07:00
Andy Wilkinson
7405efa326 Ensure that each Tomcat customizer is only called once
Fixes gh-17264
2019-06-21 17:53:24 +01:00
Stephane Nicoll
e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Phillip Webb
59ca46ed54 Remove FIXME 2019-06-18 21:41:05 -07:00
Phillip Webb
f4d9e1c650 Fix checkstyle violation 2019-06-17 14:45:17 -07:00
Phillip Webb
69fbd8f20c Merge branch '2.1.x'
Closes gh-17227
Closes gh-17228
2019-06-17 11:53:16 -07:00
ayudovin
c2d1cb2c70 Chain predicates in PropertyMapper when methods
Update `PropertyMapper` to correctly combine predicates when repeated
calls are made to `when` and `whenNot`. Prior to this commit, subsequent
invocations would replace the previous predicate.

Fixes gh-17225
2019-06-17 11:21:56 -07:00
Andy Wilkinson
c62543b514 Merge branch '2.1.x'
Closes gh-17212
2019-06-17 10:47:22 +01:00
Andy Wilkinson
13a7a52c71 Revert "Work around Framework regression in handling of null model values"
This reverts commit 5fc67c545c7b7f6440bb0743feb15d5fc2c5d28a.

Closes gh-16991
2019-06-17 10:44:23 +01:00
Phillip Webb
25839185c1 Fix checkstyle violation 2019-06-14 18:57:41 -07:00
Phillip Webb
0b3015e4ff Polish Binder classes
Polish and rename some of the internal Binder classes to better reflect
their purpose. The `BeanBinder` is now called `DataObjectBinder` and
as a `JavaBeanBinder` implementation for setter based properties, and
a `ValueObjectBinder` implementation for constructor based properties.
2019-06-14 18:14:40 -07:00
Madhura Bhave
c6dae5764e Add bindOrCreate for constructor based binding
Deprecate the existing `BindResult.orElseCreate` method in favor of
`bindOrCreate` methods on the `Binder`. These new methods allow us to
implement custom creation logic depending on the type of object being
bound. Specifically, it allows constructor based binding to create new
instances that respect the `@DefaultValue` annotations.

Closes gh-17098

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-06-14 18:14:40 -07:00
Andy Wilkinson
75da4468e5 Merge branch '2.1.x'
Closes gh-17192
2019-06-14 15:15:19 +01:00
Andy Wilkinson
d5d96dff96 Honor logback.debug property and write Logback statuses to console
Closes gh-16876
2019-06-14 15:12:05 +01:00
Madhura Bhave
4c7e457582 Improve analysis of tomcat bind exception
Using the throwOnFailure attribute on the tomcat connector, we can now
determine if the underlying exception was a BindException and throw
a PortInUseException instead of the generic WebServerException.

Closes gh-7130
2019-06-13 15:11:18 -07:00
Phillip Webb
9db20313a1 Polish "Add Printer and Parser beans to conversion service"
Extract common registration code and make use of the Spring Framework
registration methods.

See gh-17064
2019-06-13 08:54:11 -07:00
Dmytro Nosan
955eaa87ae Add Printer and Parser beans to conversion service
Update `WebMvcAutoConfiguration` and `WebFluxAutoConfiguration` so that
`Printer<T>` and `Parser<T>` beans are automatically registered with
the conversion service.

Prior to this commit only `GenericConverter`, `Converter` and
`Formatter` beans were automatically registered.

See gh-17064
2019-06-13 08:54:11 -07:00
Andy Wilkinson
cffc870fd6 Fix test failures on Windows
Since the move to JUnit 5, a number of tests were failing on Windows.
The majority were failing due to open file handles preventing the
clean up of the tests' temporary directory. This commit addresses
these failures by updating the tests to close JarFiles, InputStreams,
OutputStreams etc.

A change has also been made to CachingOperationInvokerTests to make
a flakey test more robust. Due to System.currentTimeMillis() being
less precise on Windows than it is on *nix platforms, the test could
fail as it would not sleep for long enough for the TTL period to have
expired.
2019-06-13 09:24:31 +01:00
Phillip Webb
aad21d1996 Polish "Support default headers with RestTemplateBuilder"
Broaden the scope of customizer support so that instead of focusing
just on headers, we can now customize any outgoing `HttpClientRequest`.
Also update auto-configuration to automatically add any
`RestTemplateRequestCustomizer` beans to the builder.

See gh-17091
2019-06-12 16:34:31 -07:00
Ilya Lukyanovich
43b1a667ce Support default headers with RestTemplateBuilder
Update `RestTemplateBuilder` so that it is easier to apply custom
headers to the outgoing request. The update is particularly useful
for setting the `User-Agent` header, for example so that a GitHub
username can be used when calling `api.github.com`.

See gh-17091
2019-06-12 13:49:39 -07:00
Andy Wilkinson
5e3c86ab8d Merge branch '2.1.x'
Closes gh-17122
2019-06-12 12:53:49 +01:00