001/* 002 * Copyright 2002-2019 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.test.web.reactive.server; 018 019import org.springframework.http.client.reactive.ClientHttpConnector; 020import org.springframework.lang.Nullable; 021import org.springframework.web.server.adapter.WebHttpHandlerBuilder; 022 023/** 024 * Contract that frameworks or applications can use to pre-package a set of 025 * customizations to a {@link WebTestClient.Builder} and expose that 026 * as a shortcut. 027 * 028 * @author Rossen Stoyanchev 029 * @since 5.0 030 * @see MockServerConfigurer 031 */ 032public interface WebTestClientConfigurer { 033 034 /** 035 * Invoked once only, immediately (i.e. before this method returns). 036 * @param builder the WebTestClient builder to make changes to 037 * @param httpHandlerBuilder the builder for the "mock server" HttpHandler 038 * this client was configured for "mock server" testing 039 * @param connector the connector for "live" integration tests if this 040 * server was configured for live integration testing 041 */ 042 void afterConfigurerAdded(WebTestClient.Builder builder, 043 @Nullable WebHttpHandlerBuilder httpHandlerBuilder, 044 @Nullable ClientHttpConnector connector); 045 046}