This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch tomee-9.x
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/tomee-9.x by this push:
     new 48929c5b34 TOMEE-4284 slight refactor to fix two failing unit tests
48929c5b34 is described below

commit 48929c5b3400a1e799cd98e4420a18f9bf7b5757
Author: Jonathan Gallimore <j...@jrg.me.uk>
AuthorDate: Wed Dec 6 17:03:06 2023 +0000

    TOMEE-4284 slight refactor to fix two failing unit tests
---
 .../jwt/config/JWTAuthConfigurationProperties.java        | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfigurationProperties.java
 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfigurationProperties.java
index f258d8f4ca..3094dd7841 100644
--- 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfigurationProperties.java
+++ 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/config/JWTAuthConfigurationProperties.java
@@ -121,12 +121,15 @@ public class JWTAuthConfigurationProperties {
     }
     
     private Boolean queryAllowExp(){
-        return config.getOptionalValue("tomee.mp.jwt.allow.no-exp", 
Boolean.class)
-                .or(() -> config.getOptionalValue("mp.jwt.tomee.allow.no-exp", 
Boolean.class)
-                        .map(value -> {
-                            CONFIGURATION.warning("mp.jwt.tomee.allow.no-exp 
property is deprecated, use tomee.mp.jwt.allow.no-exp propert instead.");
-                            return value;
-                        }))
+        final Optional<Boolean> allowExp = 
config.getOptionalValue("tomee.mp.jwt.allow.no-exp", Boolean.class);
+        final Optional<Boolean> allowExpDeprecatedValue = 
config.getOptionalValue("mp.jwt.tomee.allow.no-exp", Boolean.class);
+
+        if (allowExpDeprecatedValue.isPresent()) {
+            CONFIGURATION.warning("mp.jwt.tomee.allow.no-exp property is 
deprecated, use tomee.mp.jwt.allow.no-exp property instead.");
+        }
+
+        return allowExp
+                .or(() -> allowExpDeprecatedValue)
                 .orElse(false);
     }
     

Reply via email to