Commit Graph

624 Commits

Author SHA1 Message Date
Sebastien Deleuze
0d3fb0ee0f Add Kotlin code snippets to WebMvc refdoc
See gh-21778
2019-08-22 16:58:00 +02:00
Sam Brannen
53f523001e Focus examples in Testing chapter on JUnit Jupiter 2019-08-21 15:56:15 +02:00
Sam Brannen
3dc4d01b53 Fix heading for Streaming Responses section of Testing chapter 2019-08-21 15:56:15 +02:00
Sam Brannen
6ce5f9da06 Fix unmatched parentheses in @ContextHierarchy example in reference manual
See gh-23487
2019-08-21 14:18:21 +02:00
부종민
18eed79d73 Fix typo
See gh-23480
2019-08-18 08:09:56 +02:00
Sebastien Deleuze
76645644b1 Polishing
See gh-21778
2019-08-14 10:06:04 +02:00
Sebastien Deleuze
db02d38c89 Restore annotated code samples
See gh-21778
2019-08-14 10:00:16 +02:00
Sebastien Deleuze
ec740559ed Store refdoc preferred language
See gh-21778
2019-08-14 10:00:16 +02:00
Sebastien Deleuze
eff9cae314 Add global language switch capabilities to the refdoc
See gh-21778
2019-08-13 16:29:47 +02:00
Sebastien Deleuze
32a942fda9 Polishing 2019-08-13 16:29:47 +02:00
Sebastien Deleuze
a2b8ea5173 Remove the black border from code samples
See gh-21778
2019-08-13 16:29:47 +02:00
Lars Grefer
c863b8994a Improve language-switch CSS
Closes gh-23454
2019-08-13 09:42:08 +02:00
Sebastien Deleuze
b52a50a7e0 Use Kotlin extensions for ClassPathXmlApplicationContext refdoc
Closes gh-23456
2019-08-13 09:42:08 +02:00
Sebastien Deleuze
f3c7879831 Add missing css file
See gh-21778
2019-08-12 16:23:49 +02:00
Sebastien Deleuze
96658235c8 Add Kotlin code snippets to core refdoc
This commit introduces Kotlin code snippets, for now
in the core reference documentation. Other sections
will follow, as well as improvements like global
language switch.

See gh-21778
2019-08-12 15:45:18 +02:00
Michał Rowicki
ee47bc3a25 Fix typo in data access reference documentation
Closes gh-23450
2019-08-12 11:21:54 +02:00
Sam Brannen
1925526df5 Improve reference documentation for ContextClosedEvent
Closes gh-23436
2019-08-09 13:58:31 +02:00
Sam Brannen
0cdf992433 Fix grammar in Integration chapter regarding MDPs 2019-08-09 13:14:46 +02:00
Sam Brannen
e4fec9364c Improve reference documentation for @Autowired's required attribute
Prior to this commit, the corresponding documentation was misleading.

Closes gh-23428
2019-08-09 11:37:46 +02:00
Stephane Nicoll
977451064a Merge branch '5.1.x' 2019-08-09 09:37:36 +02:00
Michał Rowicki
806fcb3839 Fix typo
See gh-23437
2019-08-09 09:36:46 +02:00
Rossen Stoyanchev
63bf1bff23 Merge branch '5.1.x' 2019-08-02 16:33:02 +01:00
Rossen Stoyanchev
70be7117f3 Fix link to Spring AMQP and polish
Optimize section headings for dispaly in left hand navigation.
2019-08-02 16:32:01 +01:00
Sam Brannen
f53cdb8bd2 Introduce common SimpleUrlHandlerMapping constructors
Prior to this commit, the SimpleUrlHandlerMapping classes in Spring MVC
and Spring Webflux only had default constructors. This lead to the fact
that users often had to explicitly invoke setUrlMap() and setOrder() on
the newly instantiated SimpleUrlHandlerMapping.

In order to simplify the programmatic setup of a SimpleUrlHandlerMapping
in common scenarios, this commit introduces the following constructors.

- SimpleUrlHandlerMapping()
- SimpleUrlHandlerMapping(Map<String, ?> urlMap)
- SimpleUrlHandlerMapping(Map<String, ?> urlMap, int order)

Closes gh-23362
2019-07-28 17:59:19 +02:00
Sam Brannen
0a822ddf2d Fix typo in reference manual 2019-07-28 16:36:12 +02:00
Sam Brannen
1075bae280 Document repeatable @TestPropertySource support in reference manual
See gh-23320
2019-07-27 23:02:43 +02:00
Sam Brannen
c3c152f806 Add multi-prefix comment support for @SqlConfig
gh-23289 introduced support for multiple single-line comment prefixes
for ScriptUtils, ResourceDatabasePopulator, and EmbeddedDatabaseBuilder.

This commit adds the same support for @SqlConfig in the TestContext
Framework. Specifically, @SqlConfig has a new `commentPrefixes`
attribute for setting multiple single-line comment prefixes.

Closes gh-23331
2019-07-24 12:01:14 +02:00
Sam Brannen
5190eaf503 Merge branch '5.1.x' 2019-07-22 18:37:02 +02:00
Ryan Burke
78802d4277 Fix typo in webflux.adoc 2019-07-22 18:35:53 +02:00
Sam Brannen
ccdf04e925 Document @SqlMergeMode support in reference manual
See gh-1835
2019-07-21 15:37:51 +02:00
Rossen Stoyanchev
24e96b6c79 Merge branch '5.1.x' 2019-07-19 10:52:30 +01:00
Rossen Stoyanchev
2b94205ba9 Update docs on multipart with RestTemplate
Replace docs on using MultipartBodyBuilder for the RestTemplate with
examples that show MultiValueMap. Originally the idea was to make
MultipartBodyBuilder accessible to the RestTemplate too, but with
support for async parts that's no longer a good fit.

Closes gh-23295
2019-07-19 10:43:50 +01:00
Sam Brannen
56eadff34f Merge branch '5.1.x' 2019-07-17 18:58:08 +02:00
Sam Brannen
74ddf1bee5 Improve documentation for @Autowired constructors
Prior to this commit, there was some ambiguity surrounding semantics
for @Autowired constructors and `required = true`, especially for
multiple @Autowired constructors.

This commit improves the documentation in the Javadoc for @Autowired as
well as in the reference manual.

Closes gh-23263
2019-07-17 18:55:58 +02:00
Sebastien Deleuze
639a254e0d Polishing 2019-07-17 16:44:34 +02:00
Sebastien Deleuze
4e2b51bedb Improve Kotlin integration testing documentation
Closes gh-22875
2019-07-17 16:37:27 +02:00
Rob Winch
fde92793b5 Fix http URLs
See gh-22839
2019-07-11 18:14:20 +02:00
Sam Brannen
fc38bb4fc6 Change @TestConstructor.autowire attribute into an enum
Prior to this commit, @TestConstructor supported a boolean `autowire`
attribute which naturally limited the configuration to two states: on
or off. Since we may need to support additional autowiring modes in the
future, the use of a boolean is limiting.

This commit address this issue by introducing a new AutowireMode enum
in @TestConstructor with ALL and ANNOTATED constants. In addition, the
attribute has been renamed to `autowireMode`, and the system property
has been renamed to `spring.test.constructor.autowire.mode` for greater
clarity of purpose.

Closes gh-23224
2019-07-11 18:00:52 +02:00
Sebastien Deleuze
2b4d6ce354 Add body methods with Object parameter to WebFlux
The commit deprecates syncBody(Object) in favor of body(Object)
which has the same behavior in ServerResponse, WebClient and
WebTestClient. It also adds body(Object, Class) and
body(Object, ParameterizedTypeReference) methods in order to support
any reactive type that can be adapted to a Publisher via
ReactiveAdapterRegistry. Related BodyInserters#fromProducer
methods are provided as well.

Shadowed Kotlin body<T>() extensions are deprecated in favor of
bodyWithType<T>() ones, including dedicated Publisher<T> and
Flow<T> variants. Coroutines extensions are adapted as well, and
body(Object) can now be used with suspending functions.

Closes gh-23212
2019-07-07 22:27:57 +02:00
Lonre Wang
8bfc920ac5 Fix typo in data-access.adoc
Closes gh-23247
2019-07-07 19:11:50 +02:00
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