Java Code Examples for org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder#merge()

The following examples show how to use org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder#merge() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlUnitRequestBuilder.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
public Object merge(@Nullable Object parent) {
	if (parent instanceof RequestBuilder) {
		if (parent instanceof MockHttpServletRequestBuilder) {
			MockHttpServletRequestBuilder copiedParent = MockMvcRequestBuilders.get("/");
			copiedParent.merge(parent);
			this.parentBuilder = copiedParent;
		}
		else {
			this.parentBuilder = (RequestBuilder) parent;
		}
		if (parent instanceof SmartRequestBuilder) {
			this.parentPostProcessor = (SmartRequestBuilder) parent;
		}
	}
	return this;
}
 
Example 2
Source File: HtmlUnitRequestBuilder.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
public Object merge(@Nullable Object parent) {
	if (parent instanceof RequestBuilder) {
		if (parent instanceof MockHttpServletRequestBuilder) {
			MockHttpServletRequestBuilder copiedParent = MockMvcRequestBuilders.get("/");
			copiedParent.merge(parent);
			this.parentBuilder = copiedParent;
		}
		else {
			this.parentBuilder = (RequestBuilder) parent;
		}
		if (parent instanceof SmartRequestBuilder) {
			this.parentPostProcessor = (SmartRequestBuilder) parent;
		}
	}
	return this;
}