mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '3.5.x'
Closes gh-48283
This commit is contained in:
+3
-3
@@ -52,12 +52,12 @@ public class ContextPairs {
|
||||
/**
|
||||
* Add pairs using flat naming.
|
||||
* @param <T> the item type
|
||||
* @param delimeter the delimiter used if there is a prefix
|
||||
* @param delimiter the delimiter used if there is a prefix
|
||||
* @param pairs callback to add all the pairs
|
||||
* @return a {@link BiConsumer} for use with the {@link JsonWriter}
|
||||
*/
|
||||
public <T> BiConsumer<T, BiConsumer<String, Object>> flat(String delimeter, Consumer<Pairs<T>> pairs) {
|
||||
return flat(joinWith(delimeter), pairs);
|
||||
public <T> BiConsumer<T, BiConsumer<String, Object>> flat(String delimiter, Consumer<Pairs<T>> pairs) {
|
||||
return flat(joinWith(delimiter), pairs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ class ContextPairsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void flatWhenPrefixEndingWithDelimeterAppliesPrefix() {
|
||||
void flatWhenPrefixEndingWithDelimiterAppliesPrefix() {
|
||||
ContextPairs contextPairs = new ContextPairs(true, "the_");
|
||||
Map<String, String> map = Map.of("spring", "boot");
|
||||
Map<String, Object> actual = apply(contextPairs.flat("_", (pairs) -> pairs.addMapEntries((item) -> map)));
|
||||
@@ -66,7 +66,7 @@ class ContextPairsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void flatWhenPrefixAndNameStartingWithDelimeterAppliesPrefix() {
|
||||
void flatWhenPrefixAndNameStartingWithDelimiterAppliesPrefix() {
|
||||
ContextPairs contextPairs = new ContextPairs(true, "the");
|
||||
Map<String, String> map = Map.of("_spring", "boot");
|
||||
Map<String, Object> actual = apply(contextPairs.flat("_", (pairs) -> pairs.addMapEntries((item) -> map)));
|
||||
|
||||
Reference in New Issue
Block a user