Skip to content

Commit 497a1f7

Browse files
committed
Merge branch '3.3.x' into 3.4.x
Closes gh-45224
2 parents 240ce44 + ad61236 commit 497a1f7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ The following activation properties are available:
545545
| Property | Note
546546

547547
| `on-profile`
548-
| A profile expression that must match for the document to be active.
548+
| A profile expression that must match for the document to be active, or a list of profile expressions of which at least one must match for the document to be active.
549549

550550
| `on-cloud-platform`
551551
| The javadoc:org.springframework.boot.cloud.CloudPlatform[] that must be detected for the document to be active.

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataPropertiesTests.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -200,6 +200,17 @@ void isActiveAgainstBoundDataWhenCloudPlatformDoesntMatch() {
200200
assertThat(properties.isActive(context)).isFalse();
201201
}
202202

203+
@Test
204+
void isActiveAgainstBoundDataWhenProfilesMatchCommaSeparatedList() {
205+
MapConfigurationPropertySource source = new MapConfigurationPropertySource();
206+
source.put("spring.config.activate.on-profile", "a&b,nonexistent");
207+
Binder binder = new Binder(source);
208+
ConfigDataProperties properties = ConfigDataProperties.get(binder);
209+
ConfigDataActivationContext context = new ConfigDataActivationContext(NULL_CLOUD_PLATFORM,
210+
createTestProfiles());
211+
assertThat(properties.isActive(context)).isTrue();
212+
}
213+
203214
@Test
204215
void getImportOriginWhenCommaListReturnsOrigin() {
205216
MapConfigurationPropertySource source = new MapConfigurationPropertySource();

0 commit comments

Comments
 (0)