withBasicAuth

open fun withBasicAuth(username: String, password: String): TestRestTemplate

Creates a new TestRestTemplate with the same configuration as this one, except that it will send basic authorization headers using the given username and password. The request factory used is a new instance of the underlying RestTemplate's request factory type (when possible).

Return

the new template

Since

1.4.1

Parameters

username

the username

password

the password