Update examples to use Environment#matchesProfiles()
This commit is contained in:
@@ -541,7 +541,7 @@ Java::
|
|||||||
MultiValueMap<String, Object> attrs = metadata.getAllAnnotationAttributes(Profile.class.getName());
|
MultiValueMap<String, Object> attrs = metadata.getAllAnnotationAttributes(Profile.class.getName());
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
for (Object value : attrs.get("value")) {
|
for (Object value : attrs.get("value")) {
|
||||||
if (context.getEnvironment().acceptsProfiles(((String[]) value))) {
|
if (context.getEnvironment().matchesProfiles((String[]) value)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -560,7 +560,7 @@ Kotlin::
|
|||||||
val attrs = metadata.getAllAnnotationAttributes(Profile::class.java.name)
|
val attrs = metadata.getAllAnnotationAttributes(Profile::class.java.name)
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
for (value in attrs["value"]!!) {
|
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
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user