Closed klauss42 closed 2 months ago
Hi, I also noticed the following exception in karibu-tests themselves:
The same exception com.vaadin.flow.router.AccessDeniedException has been thrown several times during navigation. Can't use any HasErrorParameter view for this error.
I think this is the reason why the test fails, but unfortunately I haven't got the chance to analyze this change of Vaadin's behavior in depth.
Looks like the problem is as follows:
NavigationAccessControl:259
reroutes to exception AccessDeniedException
RouteAccessDeniedError
picks up the call and redirects to NotFoundException
at line 39MockRouteNotFoundError
, but it lacks any security annotationsNavigationAccessControl
is triggered and prevents access to MockRouteNotFoundError
by re-routing to AccessDeniedException
Let me write a test for this, and hopefully fix this issue by adding appropriate security annotations to MockRouteNotFoundError
Alrighty, I've fixed the issue by introducing MockRouteAccessDeniedError
which simply throws the AccessDeniedException
immediately instead of redirecting to RouteNotFoundError
. I've also added @AnonymousAllowed
to MockRouteAccessDeniedError
and MockRouteNotFoundError
, so hopefully this bug should be fixed.
Fixed in Karibu-Testing 2.1.7, will be released shortly.
Please use Karibu-Testing 2.1.8, there was a bug in 2.1.7.
Karibu tests are failing after upgrading to Vaadin 24.3.0 with the following exception:
Our application is using Spring Security and view based permissions and the Karibu tests try to verify proper role checks per view.
As it is quite complicated to explain and reproduce, I prepared a small sample app, which reproduces the problem. There are 2 tests in the sample app:
These tests run successful with Vaadin 24.2.6. With 24.3.0 the second test dealing with an AccessDenied error fails. You can reproduce by changing the version in the pom.xml
Here is the sample app: vaadin24-karibu-sample-app.zip