Spring Boot 3 & Vaadin 24: Tests fail because of NPE

I am upgrading to spring boot 3 and Vaadin 24. I got everything working except my spring boot tests. The all fail because of this NullPointerException: Caused by: java.lang.NullPointerException: Cannot invoke "com.vaadin.flow.di.Lookup.lookup(java.lang.Class)" because "lookup" is null
More specifically the exception occurs in the SecurityConfiguration at the line where the LoginView is set: setLoginView(http, LoginView.class);. Is this a Vaadin or Spring Boot issue? Maybe someone has experienced a similar issue during upgrading. It only happens during testing, the application runs fine otherwise.

https://github.com/vaadin/flow/issues/16236

Thank you!

did you find a solution @honest-vulture ? this problem gets my stuck on unittests so can’t build a new production version…

Sadly I didn’t. The suggested solution in the issue thread didn’t work for me. I reverted to v23 and am waiting for a fix until I upgrade.

auch, I started my project from 24 so strange it suddenly got broken, will try to go back to latest 23

damn, other problems when going back to 23, so no solution…

Not using the provided websecurity helper is probably a workaround for now

That’s a terrible bug!

My karibu tests with V24 are working without VaadinWebSecurity tho :grimacing:

I have another issue with Latibu testing when using Oauth client. Maybe this is also related

I don’t understand why I suddenly get these errors… did update to latest spring boot 3.0.5 and vaadin 24.0.2 but going back to earlier 3 and 24 versions doesn’t solve it

Which error? The same as in 24?

yes, have to stay in 24 otherwise I get other code errors as I started this project from 24-alpha

damn really need a fix for this… build is stuck and want to deploy a new version…

@funny-manatee help :wink:

If you really need to go forward, replace the security impl

I don’t like changing code to fix an error, but anyhow, this did solve my issue…

            setLoginView(http, LoginView.class, LOGOUT_URL);
        }

Facing this same issue at the moment, I’ll try changing the security implementation to see if I can keep advancing