Updates to*Case() to use Locale.ROOT
This commit is contained in:
committed by
Oleg Zhurakousky
parent
b65577d515
commit
900d03f816
@@ -17,6 +17,7 @@
|
||||
package org.springframework.cloud.function.actuator;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
@@ -72,10 +73,10 @@ public class FunctionsEndpoint {
|
||||
|
||||
|
||||
private String toSimplePolyOut(FunctionInvocationWrapper function) {
|
||||
return FunctionTypeUtils.getRawType(function.getItemType(function.getOutputType())).getSimpleName().toLowerCase();
|
||||
return FunctionTypeUtils.getRawType(function.getItemType(function.getOutputType())).getSimpleName().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
private String toSimplePolyIn(FunctionInvocationWrapper function) {
|
||||
return FunctionTypeUtils.getRawType(function.getItemType(function.getInputType())).getSimpleName().toLowerCase();
|
||||
return FunctionTypeUtils.getRawType(function.getItemType(function.getInputType())).getSimpleName().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
@@ -908,7 +909,7 @@ public class SimpleFunctionRegistry implements FunctionRegistry {
|
||||
if (contentType == null) {
|
||||
contentType = msg.getHeaders().get(HttpHeaders.CONTENT_TYPE);
|
||||
if (contentType == null) {
|
||||
contentType = msg.getHeaders().get(HttpHeaders.CONTENT_TYPE.toLowerCase());
|
||||
contentType = msg.getHeaders().get(HttpHeaders.CONTENT_TYPE.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
return Objects.toString(contentType);
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
package org.springframework.cloud.function.utils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.cloud.function.context.message.MessageUtils;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -59,7 +61,7 @@ public final class FunctionMessageUtils {
|
||||
else if (key.startsWith("solace_")) {
|
||||
return "solace";
|
||||
}
|
||||
else if (key.toLowerCase().equals("user-agent") || key.toLowerCase().equals("accept-encoding") || key.toLowerCase().equals("host")) {
|
||||
else if (key.toLowerCase(Locale.ROOT).equals("user-agent") || key.toLowerCase(Locale.ROOT).equals("accept-encoding") || key.toLowerCase(Locale.ROOT).equals("host")) {
|
||||
return "http";
|
||||
}
|
||||
// add rsocket
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.context;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -90,7 +91,7 @@ public class HybridFunctionalRegistrationTests {
|
||||
|
||||
@Override
|
||||
public String apply(String t) {
|
||||
return t.toUpperCase();
|
||||
return t.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ public class HybridFunctionalRegistrationTests {
|
||||
public String apply(Message<String> message) {
|
||||
assertThat(message.getHeaders().get("foo")).isEqualTo("foo");
|
||||
assertThat(message.getHeaders().get("blah")).isEqualTo("blah");
|
||||
return message.getPayload().toUpperCase();
|
||||
return message.getPayload().toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +119,7 @@ public class HybridFunctionalRegistrationTests {
|
||||
|
||||
@Override
|
||||
public Flux<String> apply(Flux<String> flux) {
|
||||
return flux.map(v -> v.toUpperCase());
|
||||
return flux.map(v -> v.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -303,7 +304,7 @@ public class BeanFactoryAwareFunctionRegistryMultiInOutTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> v.toUpperCase();
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
// ============= MULTI-INPUT and MULTI-OUTPUT functions ============
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
@@ -916,7 +917,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> v.toUpperCase();
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -931,7 +932,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<Message<Person>, String> uppercasePerson() {
|
||||
return v -> v.getPayload().getName().toUpperCase();
|
||||
return v -> v.getPayload().getName().toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1121,7 +1122,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
protected static class WrappedWithAroundAdviseConfiguration {
|
||||
@Bean
|
||||
public Function<Message<String>, Message<String>> uppercase() {
|
||||
return v -> MessageBuilder.withPayload(v.getPayload().toUpperCase()).copyHeaders(v.getHeaders()).build();
|
||||
return v -> MessageBuilder.withPayload(v.getPayload().toUpperCase(Locale.ROOT)).copyHeaders(v.getHeaders()).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -1148,7 +1149,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return x -> x.toUpperCase();
|
||||
return x -> x.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1166,7 +1167,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
@Bean
|
||||
public Function<Person, Person> uppercasePerson() {
|
||||
return person -> {
|
||||
return new Person(person.getName().toUpperCase(), person.getId());
|
||||
return new Person(person.getName().toUpperCase(Locale.ROOT), person.getId());
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1178,7 +1179,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
@Bean
|
||||
public BiFunction<String, Map, String> biFuncUpperCase() {
|
||||
return (p, h) -> {
|
||||
return p.toUpperCase();
|
||||
return p.toUpperCase(Locale.ROOT);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1192,7 +1193,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> v.toUpperCase();
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -1214,7 +1215,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<Flux<String>, Flux<String>> uppercaseFlux() {
|
||||
return flux -> flux.map(v -> v.toUpperCase());
|
||||
return flux -> flux.map(v -> v.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -1499,7 +1500,7 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
public static class ComplexTypeFunctionConfiguration {
|
||||
@Bean
|
||||
public Function<Event<String, Product>, String> function() {
|
||||
return v -> v.getData().getName().toUpperCase();
|
||||
return v -> v.getData().getName().toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1578,12 +1579,12 @@ public class BeanFactoryAwareFunctionRegistryTests {
|
||||
|
||||
@Bean
|
||||
public Function<Flux<String>, Flux<String>> functionPrimitive() {
|
||||
return flux -> flux.map(v -> v.toUpperCase());
|
||||
return flux -> flux.map(v -> v.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Function<Flux<Message<String>>, Flux<Message<String>>> functionMessage() {
|
||||
return flux -> flux.map(v -> MessageBuilder.withPayload(v.getPayload().toUpperCase()).build());
|
||||
return flux -> flux.map(v -> MessageBuilder.withPayload(v.getPayload().toUpperCase(Locale.ROOT)).build());
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.context.catalog;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -123,7 +124,7 @@ public class BeanFactoryAwarePojoFunctionRegistryTests {
|
||||
// POJO Function that implements Function
|
||||
private static class MyFunction implements Function<String, String> {
|
||||
public String uppercase(String value) {
|
||||
return value.toUpperCase();
|
||||
return value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +136,7 @@ public class BeanFactoryAwarePojoFunctionRegistryTests {
|
||||
// POJO Function
|
||||
public static class MyFunctionLike {
|
||||
public String uppercase(String value) {
|
||||
return value.toUpperCase();
|
||||
return value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
@@ -665,7 +666,7 @@ public class SimpleFunctionRegistryTests {
|
||||
}
|
||||
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> v.toUpperCase();
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
|
||||
@@ -779,7 +780,7 @@ public class SimpleFunctionRegistryTests {
|
||||
|
||||
@Override
|
||||
public String apply(String t) {
|
||||
return t.toUpperCase();
|
||||
return t.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -798,7 +799,7 @@ public class SimpleFunctionRegistryTests {
|
||||
|
||||
@Override
|
||||
public Message<String> apply(Message<String> t) {
|
||||
return MessageBuilder.withPayload(t.getPayload().toUpperCase())
|
||||
return MessageBuilder.withPayload(t.getPayload().toUpperCase(Locale.ROOT))
|
||||
.copyHeaders(t.getHeaders()).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
@@ -476,7 +477,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> function() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -543,7 +544,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, Foo> foos(String foo) {
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase());
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -560,7 +561,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Override
|
||||
public Flux<Foo> apply(Flux<String> flux) {
|
||||
return flux.map(foo -> new Foo(value() + ": " + foo.toUpperCase()));
|
||||
return flux.map(foo -> new Foo(value() + ": " + foo.toUpperCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -588,7 +589,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, Foo> foos() {
|
||||
return value -> new Foo(value.toUpperCase());
|
||||
return value -> new Foo(value.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -605,7 +606,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, Foo> foos() {
|
||||
return value -> new Foo(value.toUpperCase());
|
||||
return value -> new Foo(value.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -632,7 +633,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
@Bean
|
||||
public Function<Map<String, String>, Map<String, String>> function() {
|
||||
return m -> m.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(),
|
||||
e -> e.getValue().toString().toUpperCase()));
|
||||
e -> e.getValue().toString().toUpperCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -726,7 +727,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
@Bean
|
||||
public Function<Flux<Map<String, String>>, Flux<Map<String, String>>> function() {
|
||||
return flux -> flux.map(m -> m.entrySet().stream().collect(Collectors
|
||||
.toMap(e -> e.getKey(), e -> e.getValue().toString().toUpperCase())));
|
||||
.toMap(e -> e.getKey(), e -> e.getValue().toString().toUpperCase(Locale.ROOT))));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -738,7 +739,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
@Bean
|
||||
public Function<Flux<Message<String>>, Flux<Message<String>>> function() {
|
||||
return flux -> flux.map(m -> MessageBuilder
|
||||
.withPayload(m.getPayload().toUpperCase()).build());
|
||||
.withPayload(m.getPayload().toUpperCase(Locale.ROOT)).build());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -750,7 +751,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
@Bean
|
||||
public Function<Publisher<Message<String>>, Publisher<Message<String>>> function() {
|
||||
return flux -> Flux.from(flux).map(m -> MessageBuilder
|
||||
.withPayload(m.getPayload().toUpperCase()).build());
|
||||
.withPayload(m.getPayload().toUpperCase(Locale.ROOT)).build());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -784,7 +785,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<Message<String>, Message<String>> function() {
|
||||
return m -> MessageBuilder.withPayload(m.getPayload().toUpperCase()).build();
|
||||
return m -> MessageBuilder.withPayload(m.getPayload().toUpperCase(Locale.ROOT)).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -796,7 +797,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
@Bean
|
||||
@Qualifier("other")
|
||||
public Function<String, String> function() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -807,7 +808,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean({ "function", "other" })
|
||||
public Function<String, String> function() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -824,7 +825,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> function() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -861,7 +862,7 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
|
||||
@Override
|
||||
protected Function<String, String> createInstance() throws Exception {
|
||||
return s -> s.toUpperCase() + "-bar";
|
||||
return s -> s.toUpperCase(Locale.ROOT) + "-bar";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
@@ -235,7 +236,7 @@ public class ContextFunctionCatalogInitializerTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> function() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -264,7 +265,7 @@ public class ContextFunctionCatalogInitializerTests {
|
||||
public Function<Person, Person> function() {
|
||||
return person -> {
|
||||
Person p = new Person();
|
||||
p.setName(person.getName().toUpperCase());
|
||||
p.setName(person.getName().toUpperCase(Locale.ROOT));
|
||||
return p;
|
||||
};
|
||||
}
|
||||
@@ -359,7 +360,7 @@ public class ContextFunctionCatalogInitializerTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, Foo> foos(String foo) {
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase());
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -383,7 +384,7 @@ public class ContextFunctionCatalogInitializerTests {
|
||||
|
||||
@Override
|
||||
public Flux<Foo> apply(Flux<String> flux) {
|
||||
return flux.map(foo -> new Foo(value() + ": " + foo.toUpperCase()));
|
||||
return flux.map(foo -> new Foo(value() + ": " + foo.toUpperCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.context.scan;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ public class TestFunction implements Function<String, String> {
|
||||
|
||||
@Override
|
||||
public String apply(String t) {
|
||||
return t.toUpperCase();
|
||||
return t.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.context.string;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -52,7 +53,7 @@ public class FunctionalStringSourceTests {
|
||||
|
||||
@Override
|
||||
public String apply(String value) {
|
||||
return value.toUpperCase();
|
||||
return value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.context.test;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -49,7 +50,7 @@ public class FunctionalTests {
|
||||
|
||||
@Override
|
||||
public String apply(String value) {
|
||||
return value.toUpperCase();
|
||||
return value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.inject;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfigurationTests.Foo;
|
||||
@@ -27,7 +28,7 @@ public class FooConfiguration {
|
||||
|
||||
@Bean
|
||||
public Function<String, Foo> foos(String foo) {
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase());
|
||||
return value -> new Foo(foo + ": " + value.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.scan;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -33,7 +34,7 @@ public class ScannedFunction
|
||||
@Override
|
||||
public Map<String, String> apply(Map<String, String> m) {
|
||||
return m.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(),
|
||||
e -> e.getValue().toString().toUpperCase()));
|
||||
e -> e.getValue().toString().toUpperCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.function.test;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -33,7 +34,7 @@ public class GenericFunction {
|
||||
@Bean
|
||||
public Function<Map<String, String>, Map<String, String>> function() {
|
||||
return m -> m.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(),
|
||||
e -> e.getValue().toString().toUpperCase()));
|
||||
e -> e.getValue().toString().toUpperCase(Locale.ROOT)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user