Commit Graph

584 Commits

Author SHA1 Message Date
Rossen Stoyanchev
97d020c509 Merge branch '5.1.x' 2019-07-05 10:55:49 +01:00
Rossen Stoyanchev
2088a3d57b Document async requests with Spring MVC Test
Closes gh-19666
2019-07-05 10:30:02 +01:00
Sam Brannen
5008423408 Support multipart/* MediaTypes in RestTemplate
Prior to this commit, RestTemplate posted multipart with Content-Type
"multipart/form-data" even if the FormHttpMessageConverter configured
in the RestTemplate had been configured to support additional multipart
subtypes. This made it impossible to POST form data using a content
type such as "multipart/mixed" or "multipart/related".

This commit addresses this issue by updating FormHttpMessageConverter
to support custom multipart subtypes for writing form data.

For example, the following use case is now supported.

MediaType multipartMixed = new MediaType("multipart", "mixed");

restTemplate.getMessageConverters().stream()
    .filter(FormHttpMessageConverter.class::isInstance)
    .map(FormHttpMessageConverter.class::cast)
    .findFirst()
    .orElseThrow(() ->
        new IllegalStateException("Failed to find FormHttpMessageConverter"))
    .addSupportedMediaTypes(multipartMixed);

MultiValueMap<String, Object> parts = new LinkedMultiValueMap<>();
parts.add("field 1", "value 1");
parts.add("file", new ClassPathResource("myFile.jpg"));

HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(multipartMixed);
HttpEntity<MultiValueMap<String, Object>> requestEntity =
    new HttpEntity<>(parts, requestHeaders);

restTemplate.postForLocation("https://example.com/myFileUpload", requestEntity);

Closes gh-23159
2019-06-28 17:13:18 +03:00
Sam Brannen
beb454a299 Use HTTPS links in documentation where possible 2019-06-21 16:51:44 +03:00
Sam Brannen
2f4c97cbdb Merge branch '5.1.x' 2019-06-21 12:46:21 +03:00
Sam Brannen
97bfb75fbc Polish documentation for @ControllerAdvice in reference manual 2019-06-21 12:45:08 +03:00
Sebastien Deleuze
da582dad7c Add documentation for Coroutines dependencies 2019-06-20 16:11:20 +02:00
Sebastien Deleuze
e86b937f8c Leverage new Kotlin script templating support
As of 1.3.40, Kotlin now provides a kotlin-scripting-jsr223-embeddable
dependency which:
 - Fixes classloading related issues
 - Provides out of the box JSR 223 support
 - Is compatible with Spring Boot Fat Jar mechanism

This commit updates Spring Framework tests and documentation accordingly.

Closes gh-23165
2019-06-20 10:17:02 +02:00
Sebastien Deleuze
341385acfc Merge branch '5.1.x' 2019-06-19 13:59:59 +02:00
Sebastien Deleuze
bcad276adb Fix Jackson documentation broken links
Closes gh-23153
2019-06-19 13:59:36 +02:00
Sebastien Deleuze
ea97fefa98 Merge branch '5.1.x' 2019-06-18 16:52:29 +02:00
Sebastien Deleuze
bd568ea2f1 Document how to specify Jackson JSON view serialization hints
Closes gh-23150
2019-06-18 16:50:54 +02:00
Sam Brannen
8ceac9c015 Document supported @Transactional attributes in the TCF
This commit documents which attributes in @Transactional are supported
for test-managed transactions in the Spring TestContext Framework (TCF).

Closes gh-23149
2019-06-18 14:34:28 +03:00
Sam Brannen
c4075cf216 Document WebFlux FreeMarker macro support in Reference Manual
Closes gh-23133
2019-06-13 17:40:18 +03:00
Sam Brannen
74d520fbfa Polish @Value documentation in the Reference Manual
See gh-23052
2019-06-11 23:07:23 +03:00
Sebastien Deleuze
1af43d7164 Rework @Value documentation
See gh-23052
2019-06-11 17:54:43 +02:00
Sylvain Lemoine
74fcb0c5e8 Add proper @Value documentation
Closes gh-23052
2019-06-11 12:06:42 +02:00
Rossen Stoyanchev
69eba32284 Improved Part support in MultipartBodyBuilder
1. Add contentType and filename options to PartBuilder.

2. Revert recently committed #44659f since asyncPart can't properly
support Publisher of Part (only Mono, can't support filename), and
replace that with support for Part in the regular part method.

Closes gh-23083
2019-06-04 17:21:39 -04:00
Sam Brannen
3a8388ec8d Merge branch '5.1.x' 2019-06-04 12:01:58 +03:00
Jay Bryant
68333171b6 Reintroduce author list and copyright notice
Closes gh-23049
2019-06-04 11:54:58 +03:00
Sebastien Deleuze
e0bb712bfc Update Kotlin documentation 2019-05-31 14:15:44 +02:00
zyan
f492e37370 Fix typo
provices -> provides

See gh-23046
2019-05-28 16:00:35 +02:00
Sebastien Deleuze
9905200f69 Merge branch '5.1.x' 2019-05-28 08:01:23 +02:00
Artsiom Chapialiou
0267bcb404 Fix broken asciidoc link to declarative transaction management
Closes gh-23041
2019-05-28 08:00:00 +02:00
Diego Castro
2f8aa368fe Fix code example for validation on functional endpoints
Closes gh-23020
2019-05-24 09:41:17 +02:00
Rossen Stoyanchev
013249757a Merge branch '5.1.x' 2019-05-15 16:44:05 -04:00
Rossen Stoyanchev
e0b9ed6d72 Fix typo in reference
Closes gh-22975
2019-05-15 16:13:02 -04:00
Juergen Hoeller
e0654a5b3d Merge branch '5.1.x' 2019-05-13 19:22:07 +02:00
Juergen Hoeller
d3110c452e SpEL documentation refinements 2019-05-13 19:15:45 +02:00
Stephane Nicoll
6d69a4e03a Merge branch '5.1.x' 2019-05-10 09:57:25 +02:00
Andrew McCallum
9294b1d7eb Fix typo
Closes gh-22938
2019-05-10 09:56:47 +02:00
Sam Brannen
1be29d5933 Document automatic constructor injection in JUnit Jupiter
Closes gh-22928
2019-05-09 16:16:32 +02:00
Juergen Hoeller
0b50d1eff3 Merge branch '5.1.x' 2019-05-09 14:29:37 +02:00
Denis Zavedeev
484ec64305 Minor integration doc refinements 2019-05-09 14:27:22 +02:00
Denis Zavedeev
c80028b71e Fix trivial errors in integration.adoc 2019-05-09 13:50:26 +02:00
Juergen Hoeller
e3fa4e1350 Merge branch '5.1.x' 2019-05-07 14:24:28 +02:00
Juergen Hoeller
ecc165a94f Consistent spelling on index page 2019-05-07 13:46:27 +02:00
Nicofisi
0e980324e6 Add a space in the documentation index file 2019-05-07 13:29:59 +02:00
Sebastien Deleuze
89454e69c3 Deprecate MediaType.APPLICATION_JSON_UTF8
This commit deprecates MediaType.APPLICATION_JSON_UTF8 and
MediaType.APPLICATION_PROBLEM_JSON_UTF8 in favor of
MediaType.APPLICATION_JSON and MediaType.APPLICATION_PROBLEM_JSON since
UTF-8 encoding is now handled correctly by most browsers
(related bug has been fixed in Chrome since September 2017).

MediaType.APPLICATION_JSON is now used as the default JSON content type.

Closes gh-22788
2019-04-30 16:11:50 +02:00
Sebastien Deleuze
2e6059f6b0 Add coroutines support to RSocket @MessageMapping
Closes gh-22780
2019-04-30 15:48:18 +02:00
Sam Brannen
3d0ec509ab Document mock JNDI support deprecation in the Reference Manual
See gh-22779
2019-04-11 16:46:50 +02:00
Sebastien Deleuze
849a848f23 Polishing 2019-04-10 00:32:20 +02:00
Sebastien Deleuze
ff1f368751 Improve Kotlin documentation 2019-04-09 23:54:22 +02:00
Sebastien Deleuze
cd0b517abf Improve Kotlin documentation 2019-04-09 12:28:00 +02:00
Juergen Hoeller
43cb1af26a Polishing 2019-04-08 15:33:26 +02:00
Sam Brannen
353e092bf6 Register EventPublishingTestExecutionListener by default (round 2)
This commit registers the EventPublishingTestExecutionListener as a
default TestExecutionListener with an order of 10,000. This registers
the EventPublishingTestExecutionListener as the last listener provided
by the Spring Framework.

With EventPublishingTestExecutionListener registered with an order of
10,000, it is effectively wrapped by all other Spring listeners,
including support for @DirtiesContext and test-managed transactions.

Furthermore, this commit revises the implementation of
EventPublishingTestExecutionListener to take advantage of the new
TestContext#hasApplicationContext() support which allows the
EventPublishingTestExecutionListener to publish events only if the
test's ApplicationContext is currently available. This avoids
undesirable side-effects such as eager loading of the
ApplicationContext before it is needed or re-loading of the
ApplicationContext after it has been intentionally closed.

Closes gh-18490
2019-04-06 16:39:26 +02:00
Tadaya Tsuyukubo
dacda5859a Fix broken asciidoc heading 2019-04-06 11:02:45 +02:00
Sam Brannen
f7a5b3013e Revert "Register EventPublishingTestExecutionListener by default"
This reverts commit 13543f5e0f.
2019-04-04 19:10:58 +02:00
Sam Brannen
a5e297a161 Polishing 2019-04-04 18:41:57 +02:00
Juergen Hoeller
1741b6dcd9 Merge branch '5.1.x' 2019-04-04 16:12:07 +02:00