|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright 2002-2022 the original author or authors.
|
|
|
|
|
|
+ * Copyright 2002-2023 the original author or authors.
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -107,7 +107,7 @@ public interface ClaimAccessor {
|
|
}
|
|
}
|
|
Object claimValue = getClaims().get(claim);
|
|
Object claimValue = getClaims().get(claim);
|
|
Instant convertedValue = ClaimConversionService.getSharedInstance().convert(claimValue, Instant.class);
|
|
Instant convertedValue = ClaimConversionService.getSharedInstance().convert(claimValue, Instant.class);
|
|
- Assert.isTrue(convertedValue != null,
|
|
|
|
|
|
+ Assert.notNull(convertedValue,
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Instant.");
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Instant.");
|
|
return convertedValue;
|
|
return convertedValue;
|
|
}
|
|
}
|
|
@@ -123,7 +123,7 @@ public interface ClaimAccessor {
|
|
}
|
|
}
|
|
Object claimValue = getClaims().get(claim);
|
|
Object claimValue = getClaims().get(claim);
|
|
URL convertedValue = ClaimConversionService.getSharedInstance().convert(claimValue, URL.class);
|
|
URL convertedValue = ClaimConversionService.getSharedInstance().convert(claimValue, URL.class);
|
|
- Assert.isTrue(convertedValue != null,
|
|
|
|
|
|
+ Assert.notNull(convertedValue,
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to URL.");
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to URL.");
|
|
return convertedValue;
|
|
return convertedValue;
|
|
}
|
|
}
|
|
@@ -148,7 +148,7 @@ public interface ClaimAccessor {
|
|
Object claimValue = getClaims().get(claim);
|
|
Object claimValue = getClaims().get(claim);
|
|
Map<String, Object> convertedValue = (Map<String, Object>) ClaimConversionService.getSharedInstance()
|
|
Map<String, Object> convertedValue = (Map<String, Object>) ClaimConversionService.getSharedInstance()
|
|
.convert(claimValue, sourceDescriptor, targetDescriptor);
|
|
.convert(claimValue, sourceDescriptor, targetDescriptor);
|
|
- Assert.isTrue(convertedValue != null,
|
|
|
|
|
|
+ Assert.notNull(convertedValue,
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Map.");
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to Map.");
|
|
return convertedValue;
|
|
return convertedValue;
|
|
}
|
|
}
|
|
@@ -173,7 +173,7 @@ public interface ClaimAccessor {
|
|
Object claimValue = getClaims().get(claim);
|
|
Object claimValue = getClaims().get(claim);
|
|
List<String> convertedValue = (List<String>) ClaimConversionService.getSharedInstance()
|
|
List<String> convertedValue = (List<String>) ClaimConversionService.getSharedInstance()
|
|
.convert(claimValue, sourceDescriptor, targetDescriptor);
|
|
.convert(claimValue, sourceDescriptor, targetDescriptor);
|
|
- Assert.isTrue(convertedValue != null,
|
|
|
|
|
|
+ Assert.notNull(convertedValue,
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to List.");
|
|
() -> "Unable to convert claim '" + claim + "' of type '" + claimValue.getClass() + "' to List.");
|
|
return convertedValue;
|
|
return convertedValue;
|
|
}
|
|
}
|