title: How do you disable Okta auto configuration for testing?
body: <p>I'm using <a href="https://mvnrepository.com/artifact/com.okta.spring/okta-spring-boot-starter/1.4.0" rel="nofollow noreferrer">this Okta Spring Boot starter</a>, but I cannot disable the auto configuration for integration testing. Normally, you would do something like this:</p>
  <pre class="lang-java prettyprint-override"><code>@SpringBootTest
  @EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class, OktaOAuth2AutoConfig.class })
  class ApplicationTests {
  
      @Test
      void contextLoads() {
      }
  }
  </code></pre>
  <p>However, the OktaOAuth2AutoConfig class is package protected and you cannot disable it. I've tried component scanning filters and a bunch of other techniques, but the problem is that it is still loading and requiring <code>okta.oauth2.issuer</code> (along with client id and secret) and calling it to make sure it is a valid OAuth2 provider. I don't want this functionality in case the tests have to run somewhere where the auto config can't call the issuer. Any ideas?</p>