类的使用
org.springframework.boot.test.web.client.TestRestTemplate
使用TestRestTemplate的程序包
-
org.springframework.boot.test.web.client中TestRestTemplate的使用
修饰符和类型方法说明TestRestTemplate.withBasicAuth(String username, String password) Creates a newTestRestTemplatewith the same configuration as this one, except that it will send basic authorization headers using the givenusernameandpassword.TestRestTemplate.withRedirects(ClientHttpRequestFactorySettings.Redirects redirects) Creates a newTestRestTemplatewith the same configuration as this one, except that it will apply the givenClientHttpRequestFactorySettings.Redirects.TestRestTemplate.withRequestFactorySettings(UnaryOperator<ClientHttpRequestFactorySettings> requestFactorySettingsCustomizer) Creates a newTestRestTemplatewith the same configuration as this one, except that it will customize theClientHttpRequestFactorySettings.TestRestTemplate.withRequestFactorySettings(ClientHttpRequestFactorySettings requestFactorySettings) Creates a newTestRestTemplatewith the same configuration as this one, except that it will apply the givenClientHttpRequestFactorySettings.