Build #7,538

Build: #7538 failed Changes by Sam Brannen

Build result summary

Details

Completed
Duration
39 minutes
Labels
None
Agent
bamboo-15.af.pivotal.io
Revisions
Spring Framework
5008423408dfd474a49240a5728c7790b8c24bff 5008423408dfd474a49240a5728c7790b8c24bff
Plan Repository
5008423408dfd474a49240a5728c7790b8c24bff 5008423408dfd474a49240a5728c7790b8c24bff
Total tests
17324
Failing since
#7537 (Changes by Sam Brannen)
Fixed in
#7539 (Changes by Sam Brannen)
No failed tests found, a possible compilation error occurred.

Tests

Responsible

Comments on Default Job

  1. Anonymous user

    Detected hung build state. Attempting to generate stack trace and terminate spawned sub-processes.

Code commits

Spring Framework
Author Commit Message Commit date
Sam Brannen Sam Brannen 5008423408dfd474a49240a5728c7790b8c24bff 5008423408dfd474a49240a5728c7790b8c24bff 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
Plan Repository
Author Commit Message Commit date
Sam Brannen Sam Brannen 5008423408dfd474a49240a5728c7790b8c24bff 5008423408dfd474a49240a5728c7790b8c24bff 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

Error summary for Default Job

The job generated some errors, drill down into the full build log for more details.

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Force Stop build feature is enabled for current plan. Either Bamboo has detected the build has hung or it has been manually stopped.