Skip to content

Commit

Permalink
Clarify that we discard mockMvc.perform((RequestBuilder) null) test
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaMuravjov committed Aug 25, 2023
1 parent 1a253c4 commit 79ef8e0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class SpringUtExecutionInstrumentation(
if (parameters !is UtConcreteExecutionData) {
throw IllegalArgumentException("Argument parameters must be of type UtConcreteExecutionData, but was: ${parameters?.javaClass}")
}

// `RemovingConstructFailsUtExecutionInstrumentation` may detect that we fail to
// construct `RequestBuilder` and use `requestBuilder = null`, leading to a nonsensical
// test `mockMvc.perform((RequestBuilder) null)`, which we should discard
if (parameters.stateBefore.executableToCall == mockMvcPerformMethodId && parameters.stateBefore.parameters.single().isNull())
return UtConcreteExecutionResult(
stateBefore = parameters.stateBefore,
Expand Down

0 comments on commit 79ef8e0

Please sign in to comment.