From 1a40a91ee6b35b93672a55d47264189fbd4d4781 Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Tue, 23 May 2023 17:28:16 +0200 Subject: [PATCH] test: override ContextualStorageManager in UiContextTest (#132) 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 --- .../test/java/com/vaadin/quarkus/context/UiContextTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/test/java/com/vaadin/quarkus/context/UiContextTest.java b/runtime/src/test/java/com/vaadin/quarkus/context/UiContextTest.java index 406889e..90ba864 100644 --- a/runtime/src/test/java/com/vaadin/quarkus/context/UiContextTest.java +++ b/runtime/src/test/java/com/vaadin/quarkus/context/UiContextTest.java @@ -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; @@ -55,6 +57,8 @@ BeanManager getBeanManager() { @Dependent @Unremovable + @Alternative + @Priority(1) public static class TestContextualStorageManager extends UIScopedContext.ContextualStorageManager {