adding @ANy
diff --git a/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/cdi/GeronimoJwtAuthExtension.java b/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/cdi/GeronimoJwtAuthExtension.java
index 8316b65..8c8341e 100644
--- a/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/cdi/GeronimoJwtAuthExtension.java
+++ b/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/cdi/GeronimoJwtAuthExtension.java
@@ -36,6 +36,7 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
@@ -92,7 +93,7 @@
.id(GeronimoJwtAuthExtension.class.getName() + "#" + JsonWebToken.class.getName())
.beanClass(JsonWebToken.class)
.types(JsonWebToken.class, Object.class)
- .qualifiers(Default.Literal.INSTANCE)
+ .qualifiers(Default.Literal.INSTANCE, Any.Literal.INSTANCE)
.scope(ApplicationScoped.class)
.createWith(ctx -> {
final JwtRequest request = this.request.get();
@@ -105,8 +106,7 @@
injectionPoints.forEach(injection ->
afterBeanDiscovery.addBean()
.id(GeronimoJwtAuthExtension.class.getName() + "#" + injection.getId())
- .beanClass(injection.findClass())
- .qualifiers(injection.literal())
+ .qualifiers(injection.literal(), Any.Literal.INSTANCE)
.scope(injection.findScope())
.types(injection.type, Object.class)
.createWith(ctx -> injection.createInstance(request.get())));
@@ -334,7 +334,7 @@
return false;
}
final Injection injection = Injection.class.cast(o);
- return name.equals(injection.name) && claims == injection.claims && type.equals(injection.type);
+ return runtimeName.equals(injection.runtimeName) && type.equals(injection.type);
}
@Override
@@ -344,10 +344,7 @@
@Override
public String toString() {
- return "Injection{" +
- "claim='" + ofNullable(name).filter(n -> !n.isEmpty()).orElse(claims.name()) +
- "', type=" + type +
- '}';
+ return "Injection{claim='" + runtimeName + "', type=" + type + '}';
}
}
diff --git a/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/jwt/GeronimoJsonWebToken.java b/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/jwt/GeronimoJsonWebToken.java
index bc009e2..7a6f796 100644
--- a/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/jwt/GeronimoJsonWebToken.java
+++ b/geronimo-jwt-auth-impl/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/jwt/GeronimoJsonWebToken.java
@@ -16,6 +16,7 @@
*/
package org.apache.geronimo.microprofile.impl.jwtauth.jwt;
+import static java.util.Collections.emptySet;
import static java.util.stream.Collectors.toSet;
import java.util.Set;
@@ -67,6 +68,9 @@
}
if (claim.getType() == Set.class) {
final JsonValue jsonValue = delegate.get(claimName);
+ if (jsonValue == null) {
+ return (T) emptySet();
+ }
if (jsonValue.getValueType() == JsonValue.ValueType.ARRAY) {
return (T) JsonArray.class.cast(jsonValue).stream()
.map(this::toString)
diff --git a/geronimo-jwt-auth-impl/src/test/resources/dev.xml b/geronimo-jwt-auth-impl/src/test/resources/dev.xml
index b0e1289..184c34b 100644
--- a/geronimo-jwt-auth-impl/src/test/resources/dev.xml
+++ b/geronimo-jwt-auth-impl/src/test/resources/dev.xml
@@ -15,10 +15,6 @@
<test name="Tests">
<classes>
<class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.PrimitiveInjectionTest">
- <methods>
- <include name="verifyInjectedAudience"/>
- <include name="verifyInjectedGroups"/>
- </methods>
</class>
</classes>
</test>