gnodet-bot commented on code in PR #27689: URL: https://github.com/apache/camel/pull/27689#discussion_r4246418513
########## components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpMultiValueHeaderTest.java: ########## @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.vertx.http; + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import io.vertx.core.json.JsonArray; +import io.vertx.core.json.JsonObject; +import org.apache.camel.RoutesBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * A header whose value is a collection or an object array (as the HTTP consumers map a repeated request header) must be + * sent as one HTTP header per value. Any other value is one header. + */ +class VertxHttpMultiValueHeaderTest extends VertxHttpTestSupport { + + private static final String NOT_SENT = "X-Test was not sent"; + + @Test + void sendsEachValueOfAListHeader() { + String result = template.requestBodyAndHeader(getProducerUri(), null, "X-Test", List.of("a", "b"), String.class); + assertEquals("a|b", result); Review Comment: 💡 **Minor / Low severity** — `sendsEachValueOfAListHeader` tests `List.of("a", "b")` but the single-element case (`List.of("a")`) has no integration-test coverage (unit-level coverage exists via `applyHeaderValueGivesTheOnlyValueOfACollectionAsSingleValue`, but end-to-end it is untested). Consider adding a `sendsASingleValueListHeaderAsSingleHeader` test to rule out off-by-one issues in the HTTP layer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
