File tree Expand file tree Collapse file tree
spring-cloud-openfeign-core/src
main/java/org/springframework/cloud/openfeign/support
test/java/org/springframework/cloud/openfeign/support Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import java .util .List ;
3131import java .util .Map ;
3232import java .util .Objects ;
33- import java .util .stream .Collectors ;
3433
3534import feign .Contract ;
3635import feign .Feign ;
@@ -419,11 +418,11 @@ private boolean queryMapParamPresent(MethodMetadata data) {
419418 }
420419
421420 private void parseProduces (MethodMetadata md , RequestMapping annotation ) {
422- String clientAccepts = Arrays .stream (annotation .produces ())
421+ String [] clientAccepts = Arrays .stream (annotation .produces ())
423422 .map (s -> emptyToNull (s ))
424423 .filter (Objects ::nonNull )
425- .collect ( Collectors . joining ( ", " ) );
426- if (StringUtils . hasText ( clientAccepts ) ) {
424+ .toArray ( String []:: new );
425+ if (clientAccepts . length > 0 ) {
427426 md .template ().header (ACCEPT , clientAccepts );
428427 }
429428 }
Original file line number Diff line number Diff line change @@ -769,7 +769,7 @@ void testMultipleProducesValues() throws NoSuchMethodException {
769769 Method method = TestTemplate_MultipleProduces .class .getDeclaredMethod ("multipleProduces" );
770770 MethodMetadata data = contract .parseAndValidateMetadata (method .getDeclaringClass (), method );
771771
772- assertThat (data .template ().headers ().get ("Accept" )).containsExactly ("application/jose, application/json" );
772+ assertThat (data .template ().headers ().get ("Accept" )).containsExactly ("application/jose" , " application/json" );
773773 }
774774
775775 @ Test
@@ -793,7 +793,7 @@ void testProducesWithBlankEntryIgnored() throws NoSuchMethodException {
793793 Method method = TestTemplate_MultipleProduces .class .getDeclaredMethod ("producesWithBlankEntry" );
794794 MethodMetadata data = contract .parseAndValidateMetadata (method .getDeclaringClass (), method );
795795
796- assertThat (data .template ().headers ().get ("Accept" )).containsExactly ("application/jose, application/json" );
796+ assertThat (data .template ().headers ().get ("Accept" )).containsExactly ("application/jose" , " application/json" );
797797 }
798798
799799 @ Test
You can’t perform that action at this time.
0 commit comments