Updates to*Case() to use Locale.ROOT

This commit is contained in:
spencergibb
2024-10-18 10:53:24 -04:00
parent 8f9c17f19a
commit d120eb0731
83 changed files with 262 additions and 178 deletions

View File

@@ -16,6 +16,7 @@
package example;
import java.util.Locale;
import java.util.Map;
import java.util.function.Function;
@@ -54,7 +55,7 @@ public class Config {
Map<String, String> map = mapper.fromJson(value, Map.class);
if(map != null)
map.forEach((k, v) -> map.put(k, v != null ? v.toUpperCase() : null));
map.forEach((k, v) -> map.put(k, v != null ? v.toUpperCase(Locale.ROOT) : null));
if(context != null)
context.getLogger().info(new StringBuilder().append("Function: ")
@@ -73,12 +74,12 @@ public class Config {
@Bean
public Function<Mono<String>, Mono<String>> uppercaseReactive() {
return mono -> mono.map(value -> value.toUpperCase());
return mono -> mono.map(value -> value.toUpperCase(Locale.ROOT));
}
@Bean
public Function<Flux<String>, Flux<String>> echoStream() {
return flux -> flux.map(value -> value.toUpperCase());
return flux -> flux.map(value -> value.toUpperCase(Locale.ROOT));
}
}

View File

@@ -17,6 +17,7 @@
package example;
import java.util.List;
import java.util.Locale;
import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.HttpMethod;
@@ -54,7 +55,7 @@ public class ReactiveEchoCustomResultHandler extends FunctionInvoker<List<String
) {
functionResult
.doFirst(() -> executionContext.getLogger().info("BEGIN echo post-processing work ..."))
.mapNotNull((v) -> v.toString().toUpperCase())
.mapNotNull((v) -> v.toString().toUpperCase(Locale.ROOT))
.doFinally((signalType) -> executionContext.getLogger().info("END echo post-processing work"))
.subscribe((v) -> executionContext.getLogger().info(" " + v));
return "Kicked off job for " + rawInputs;