Replace context object with "it" argument
Closes gh-23482
This commit is contained in:
parent
6fdf5ef6ee
commit
f8d6896e40
|
@ -185,25 +185,25 @@ open class MockHttpServletRequestDsl internal constructor (private val builder:
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun perform(mockMvc: MockMvc): ResultActionsDsl {
|
internal fun perform(mockMvc: MockMvc): ResultActionsDsl {
|
||||||
contextPath?.also { builder.contextPath(contextPath!!) }
|
contextPath?.also { builder.contextPath(it) }
|
||||||
servletPath?.also { builder.servletPath(servletPath!!) }
|
servletPath?.also { builder.servletPath(it) }
|
||||||
pathInfo?.also { builder.pathInfo(pathInfo) }
|
pathInfo?.also { builder.pathInfo(it) }
|
||||||
secure?.also { builder.secure(secure!!) }
|
secure?.also { builder.secure(it) }
|
||||||
characterEncoding?.also { builder.characterEncoding(characterEncoding!!) }
|
characterEncoding?.also { builder.characterEncoding(it) }
|
||||||
content?.also {
|
content?.also {
|
||||||
when (content) {
|
when (it) {
|
||||||
is String -> builder.content(content as String)
|
is String -> builder.content(it)
|
||||||
is ByteArray -> builder.content(content as ByteArray)
|
is ByteArray -> builder.content(it)
|
||||||
else -> builder.content(content.toString())
|
else -> builder.content(it.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
accept?.also { builder.accept(accept!!) }
|
accept?.also { builder.accept(it) }
|
||||||
contentType?.also { builder.contentType(contentType!!) }
|
contentType?.also { builder.contentType(it) }
|
||||||
params?.also { builder.params(params!!) }
|
params?.also { builder.params(it) }
|
||||||
sessionAttrs?.also { builder.sessionAttrs(sessionAttrs!!) }
|
sessionAttrs?.also { builder.sessionAttrs(it) }
|
||||||
flashAttrs?.also { builder.flashAttrs(flashAttrs!!) }
|
flashAttrs?.also { builder.flashAttrs(it) }
|
||||||
session?.also { builder.session(session!!) }
|
session?.also { builder.session(it) }
|
||||||
principal?.also { builder.principal(principal!!) }
|
principal?.also { builder.principal(it) }
|
||||||
return ResultActionsDsl(mockMvc.perform(builder), mockMvc)
|
return ResultActionsDsl(mockMvc.perform(builder), mockMvc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue