title: Which class to Mock for to bypass Springboot security in integration tests
body: <pre><code>@SpringBootTest(webEnvironment = RANDOM_PORT)
  @ActiveProfiles("test")
  class ContextLoadingSpec extends Specification {
  
      @Autowired
      TestRestTemplate testRestTemplate
  
      def '/ should load the context'() {
          when:
          ResponseEntity&lt;Object&gt; entity = testRestTemplate.getForEntity('/', Object.class)
  
          then:
          entity.statusCode == HttpStatus.OK
      }
  
      @TestConfiguration
      static class Config {
  
          @Bean
          RestTemplateBuilder restTemplateBuilder() {
              return new RestTemplateBuilder()
              .basicAuthorization('user', 'xxxxxxxx')
          }
      }
  }
  </code></pre>
  
  <p>Creating a TestConfiguration doesn't seem correct to me here. The credentials should be in 'application.yml' and the authentication call should have been mocked. Please suggest a better way of writing this test.</p>