Changes because HttpMethod changed to class
This commit contains changes made because HttpMethod changed from enum to class. See gh-27697
This commit is contained in:
@@ -25,10 +25,6 @@ import org.springframework.core.annotation.SynthesizingMethodParameter
|
||||
import org.springframework.core.convert.support.DefaultConversionService
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletRequest
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletResponse
|
||||
import org.springframework.web.testfixture.servlet.MockMultipartFile
|
||||
import org.springframework.web.testfixture.servlet.MockMultipartHttpServletRequest
|
||||
import org.springframework.util.ReflectionUtils
|
||||
import org.springframework.web.bind.MissingServletRequestParameterException
|
||||
import org.springframework.web.bind.annotation.RequestParam
|
||||
@@ -39,6 +35,10 @@ import org.springframework.web.context.request.NativeWebRequest
|
||||
import org.springframework.web.context.request.ServletWebRequest
|
||||
import org.springframework.web.multipart.MultipartFile
|
||||
import org.springframework.web.multipart.support.MissingServletRequestPartException
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletRequest
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletResponse
|
||||
import org.springframework.web.testfixture.servlet.MockMultipartFile
|
||||
import org.springframework.web.testfixture.servlet.MockMultipartHttpServletRequest
|
||||
|
||||
/**
|
||||
* Kotlin test fixture for [RequestParamMethodArgumentResolver].
|
||||
@@ -156,7 +156,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun resolveNullableRequiredWithoutMultipartParameter() {
|
||||
request.method = HttpMethod.POST.name
|
||||
request.method = HttpMethod.POST.name()
|
||||
request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE
|
||||
|
||||
var result = resolver.resolveArgument(nullableMultipartParamRequired, null, webRequest, binderFactory)
|
||||
@@ -176,7 +176,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun resolveNullableNotRequiredWithoutMultipartParameter() {
|
||||
request.method = HttpMethod.POST.name
|
||||
request.method = HttpMethod.POST.name()
|
||||
request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE
|
||||
|
||||
var result = resolver.resolveArgument(nullableMultipartParamNotRequired, null, webRequest, binderFactory)
|
||||
@@ -196,7 +196,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun resolveNonNullableRequiredWithoutMultipartParameter() {
|
||||
request.method = HttpMethod.POST.name
|
||||
request.method = HttpMethod.POST.name()
|
||||
request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE
|
||||
|
||||
assertThatExceptionOfType(MissingServletRequestPartException::class.java).isThrownBy {
|
||||
@@ -217,7 +217,7 @@ class RequestParamMethodArgumentResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun resolveNonNullableNotRequiredWithoutMultipartParameter() {
|
||||
request.method = HttpMethod.POST.name
|
||||
request.method = HttpMethod.POST.name()
|
||||
request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE
|
||||
|
||||
assertThatExceptionOfType(NullPointerException::class.java).isThrownBy {
|
||||
|
||||
Reference in New Issue
Block a user