Skip to content

Commit

Permalink
test: override ContextualStorageManager in UiContextTest (#132)
Browse files Browse the repository at this point in the history
Since latest changes in Quarkus, scope annotated beans are discovered
even if the scope is not registered.
This change marks the ContextualStorageManager used in UiContextTest as
an alternative to the VaadinSessionScoped ContextualStorageManager bean
defined in UIScopedContext, preventing AmbiguousResolutionException in
tests.

Fixes #131
  • Loading branch information
mcollovati authored May 23, 2023
1 parent 1ded198 commit 1a40a91
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.vaadin.quarkus.context;

import jakarta.annotation.Priority;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.inject.Alternative;
import jakarta.enterprise.inject.spi.BeanManager;

import java.lang.reflect.Proxy;
Expand Down Expand Up @@ -55,6 +57,8 @@ BeanManager getBeanManager() {

@Dependent
@Unremovable
@Alternative
@Priority(1)
public static class TestContextualStorageManager
extends UIScopedContext.ContextualStorageManager {

Expand Down

0 comments on commit 1a40a91

Please sign in to comment.