Update examples to use Environment#matchesProfiles()

This commit is contained in:
Sam Brannen 2024-08-29 16:25:04 +02:00
parent 4fa27197a7
commit 22abcf9aef
1 changed files with 2 additions and 2 deletions

View File

@ -541,7 +541,7 @@ Java::
MultiValueMap<String, Object> attrs = metadata.getAllAnnotationAttributes(Profile.class.getName());
if (attrs != null) {
for (Object value : attrs.get("value")) {
if (context.getEnvironment().acceptsProfiles(((String[]) value))) {
if (context.getEnvironment().matchesProfiles((String[]) value)) {
return true;
}
}
@ -560,7 +560,7 @@ Kotlin::
val attrs = metadata.getAllAnnotationAttributes(Profile::class.java.name)
if (attrs != null) {
for (value in attrs["value"]!!) {
if (context.environment.acceptsProfiles(Profiles.of(*value as Array<String>))) {
if (context.environment.matchesProfiles(*value as Array<String>)) {
return true
}
}