From 39c9cb2585775f919c1118afbc3b5da49eb63d1b Mon Sep 17 00:00:00 2001
From: MDeLuise <66636702+MDeLuise@users.noreply.github.com>
Date: Mon, 18 Nov 2024 10:44:53 +0100
Subject: [PATCH] fix(test): resolve GuiceLocator instantiation errors in
MfaAuthenticatorServiceLocatorTest
---
service/security/shiro/pom.xml | 5 +++++
.../org/eclipse/kapua/service/authentication/TestModule.java | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/service/security/shiro/pom.xml b/service/security/shiro/pom.xml
index 9623c89ff3c..e763f31fff0 100644
--- a/service/security/shiro/pom.xml
+++ b/service/security/shiro/pom.xml
@@ -25,6 +25,11 @@
kapua-security-shiro
+
+ org.apache.activemq
+ artemis-server
+ test
+
org.eclipse.kapua
diff --git a/service/security/shiro/src/test/java/org/eclipse/kapua/service/authentication/TestModule.java b/service/security/shiro/src/test/java/org/eclipse/kapua/service/authentication/TestModule.java
index b39c74dac3f..93f0ecf90b3 100644
--- a/service/security/shiro/src/test/java/org/eclipse/kapua/service/authentication/TestModule.java
+++ b/service/security/shiro/src/test/java/org/eclipse/kapua/service/authentication/TestModule.java
@@ -13,13 +13,12 @@
package org.eclipse.kapua.service.authentication;
import java.util.Collections;
-
import javax.inject.Named;
+import org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal;
import org.eclipse.kapua.commons.core.AbstractKapuaModule;
import org.eclipse.kapua.commons.util.xml.JAXBContextProvider;
import org.eclipse.kapua.commons.util.xml.JAXBContextProviderImpl;
-
import com.google.inject.Provides;
public class TestModule extends AbstractKapuaModule {
@@ -27,6 +26,7 @@ public class TestModule extends AbstractKapuaModule {
@Override
protected void configureModule() {
bind(JAXBContextProvider.class).toInstance(new JAXBContextProviderImpl(Collections.emptySet()));
+ bind(UserPrincipal.class).toInstance(new UserPrincipal(""));
}
@Provides