use of io.restassured.module.mockmvc.config.AsyncConfig in project rest-assured by rest-assured.
the class MockMvcRequestSpecificationImpl method spec.
public MockMvcRequestSpecification spec(MockMvcRequestSpecification requestSpecificationToMerge) {
notNull(requestSpecificationToMerge, MockMvcRequestSpecification.class);
if (!(requestSpecificationToMerge instanceof MockMvcRequestSpecificationImpl)) {
throw new IllegalArgumentException("requestSpecificationToMerge must be an instance of " + MockMvcRequestSpecificationImpl.class.getName());
}
MockMvcRequestSpecificationImpl that = (MockMvcRequestSpecificationImpl) requestSpecificationToMerge;
Object otherRequestBody = that.getRequestBody();
if (otherRequestBody != null) {
this.requestBody = otherRequestBody;
}
if (isNotEmpty(that.getBasePath())) {
this.basePath = that.getBasePath();
}
MockMvcFactory otherMockMvcFactory = that.getMockMvcFactory();
if (otherMockMvcFactory != null && otherMockMvcFactory.isAssigned()) {
this.changeMockMvcFactoryTo(otherMockMvcFactory);
}
this.cookies(that.getCookies());
this.headers(that.getRequestHeaders());
mergeConfig(this, that);
MockHttpServletRequestBuilderInterceptor otherInterceptor = that.getInterceptor();
if (otherInterceptor != null) {
this.interceptor = otherInterceptor;
}
this.formParams(that.getFormParams());
this.queryParams(that.getQueryParams());
this.params(that.getParams());
this.attributes(that.getAttributes());
this.multiParts.addAll(that.getMultiParts());
this.resultHandlers.addAll(that.getResultHandlers());
this.requestPostProcessors.addAll(that.getRequestPostProcessors());
RequestLoggingFilter otherRequestLoggingFilter = that.getRequestLoggingFilter();
if (otherRequestLoggingFilter != null) {
this.requestLoggingFilter = otherRequestLoggingFilter;
}
Object otherAuth = that.getAuthentication();
if (otherAuth != null) {
this.authentication = otherAuth;
}
AsyncConfig otherAsyncConfig = that.getAsyncConfig();
if (otherAsyncConfig != null) {
this.asyncConfig = otherAsyncConfig;
}
return this;
}
Aggregations