Skip to content

Commit

Permalink
Replace context object with "it" argument
Browse files Browse the repository at this point in the history
Closes gh-23482
  • Loading branch information
wonwoo authored and rstoyanchev committed Dec 13, 2019
1 parent 6fdf5ef commit f8d6896
Showing 1 changed file with 16 additions and 16 deletions.
Expand Up @@ -185,25 +185,25 @@ open class MockHttpServletRequestDsl internal constructor (private val builder:
}

internal fun perform(mockMvc: MockMvc): ResultActionsDsl {
contextPath?.also { builder.contextPath(contextPath!!) }
servletPath?.also { builder.servletPath(servletPath!!) }
pathInfo?.also { builder.pathInfo(pathInfo) }
secure?.also { builder.secure(secure!!) }
characterEncoding?.also { builder.characterEncoding(characterEncoding!!) }
contextPath?.also { builder.contextPath(it) }
servletPath?.also { builder.servletPath(it) }
pathInfo?.also { builder.pathInfo(it) }
secure?.also { builder.secure(it) }
characterEncoding?.also { builder.characterEncoding(it) }
content?.also {
when (content) {
is String -> builder.content(content as String)
is ByteArray -> builder.content(content as ByteArray)
else -> builder.content(content.toString())
when (it) {
is String -> builder.content(it)
is ByteArray -> builder.content(it)
else -> builder.content(it.toString())
}
}
accept?.also { builder.accept(accept!!) }
contentType?.also { builder.contentType(contentType!!) }
params?.also { builder.params(params!!) }
sessionAttrs?.also { builder.sessionAttrs(sessionAttrs!!) }
flashAttrs?.also { builder.flashAttrs(flashAttrs!!) }
session?.also { builder.session(session!!) }
principal?.also { builder.principal(principal!!) }
accept?.also { builder.accept(it) }
contentType?.also { builder.contentType(it) }
params?.also { builder.params(it) }
sessionAttrs?.also { builder.sessionAttrs(it) }
flashAttrs?.also { builder.flashAttrs(it) }
session?.also { builder.session(it) }
principal?.also { builder.principal(it) }
return ResultActionsDsl(mockMvc.perform(builder), mockMvc)
}
}

0 comments on commit f8d6896

Please sign in to comment.