Okta integration causes all JUnit/Mockito tests to fail

I am trying to integrate Okta with an existing Spring Boot application. I am following this wiki:

I have added the gradle dependency as indicated at the bottom:

compile 'com.okta.spring:okta-spring-boot-starter:0.2.0'

However adding this dependency causes all unit tests to fail when I run gradle build

Does anyone know why?

I have the same setup, but my unit tests do not fail. I did have this issue earlier when I was using the generic oauth2 properties in application.yml to configure springboot oauth2 security earlier instead of the okta specific properties. I have the following setup:

In application.yml:
enabled: false

@ARGRM Thanks for the input. Regrettably Okta is still blocking everything. I have tried adding/removing @EnableOAuth2Sso, disabling web security via httpSecurity.authorizeRequests().anyRequest().authenticated(), and some other things I found on SO. Thus far nothing. Not exactly a selling point for Okta’s software.

Sorry to hear that. I have used two spring profiles - one for testing and one for production. In production, I have application-production.xml, where okta is enabled, while in application- testing.xml it is disabled. In addition, I am using Gradle, so I have been able to disable the okta module in the testCompile and testRuntime configurations