-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Sola opened SPR-16055 and commented
According to
https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageWriter.java#L53-L54
and
https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/codec/FormHttpMessageWriter.java#L53-L54
the FormHttpMessageWriter
should accept any MultiValueMap<String,String>
,
but the following test can't get passed
import org.junit.Assert
import org.junit.Test
import org.springframework.core.ResolvableType
import org.springframework.http.MediaType
import org.springframework.http.codec.FormHttpMessageWriter
import org.springframework.util.LinkedMultiValueMap
import org.springframework.util.MultiValueMap
class ResolvableTypeTest {
@Test
fun test() {
val writer = FormHttpMessageWriter()
Assert.assertTrue(
writer.canWrite(
ResolvableType.forInstance(LinkedMultiValueMap<String, String>()),
MediaType.APPLICATION_FORM_URLENCODED
)
)
}
private val MULTIVALUE_TYPE = ResolvableType.forClassWithGenerics(MultiValueMap::class.java, String::class.java, String::class.java)
@Test
fun testSimulate() {
Assert.assertTrue(
MULTIVALUE_TYPE.isAssignableFrom(
ResolvableType.forInstance(
LinkedMultiValueMap<String, String>()
)
)
)
}
}
// code above was written in Kotlin
Affects: 5.0 GA
Issue Links:
- Multipart form data can no longer be sent with syncBody in WebTestClient [SPR-16131] #20679 Multipart form data can no longer be sent with syncBody in WebTestClient
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug