Fix checkstyles
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.cloud.stream.binder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -116,7 +117,7 @@ class PollableConsumerTests {
|
||||
@Override
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
return MessageBuilder
|
||||
.withPayload(((String) message.getPayload()).toUpperCase())
|
||||
.withPayload(((String) message.getPayload()).toUpperCase(Locale.ROOT))
|
||||
.copyHeaders(message.getHeaders()).build();
|
||||
}
|
||||
|
||||
@@ -301,7 +302,7 @@ class PollableConsumerTests {
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
return MessageBuilder
|
||||
.withPayload(
|
||||
new String((byte[]) message.getPayload()).toUpperCase())
|
||||
new String((byte[]) message.getPayload()).toUpperCase(Locale.ROOT))
|
||||
.copyHeaders(message.getHeaders()).build();
|
||||
}
|
||||
|
||||
@@ -328,7 +329,7 @@ class PollableConsumerTests {
|
||||
@Override
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
return MessageBuilder
|
||||
.withPayload(((String) message.getPayload()).toUpperCase())
|
||||
.withPayload(((String) message.getPayload()).toUpperCase(Locale.ROOT))
|
||||
.copyHeaders(message.getHeaders()).build();
|
||||
}
|
||||
|
||||
@@ -379,7 +380,7 @@ class PollableConsumerTests {
|
||||
@Override
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
return MessageBuilder
|
||||
.withPayload(((String) message.getPayload()).toUpperCase())
|
||||
.withPayload(((String) message.getPayload()).toUpperCase(Locale.ROOT))
|
||||
.copyHeaders(message.getHeaders()).build();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -241,7 +242,7 @@ class FunctionPostProcessingTests {
|
||||
public Function<String, String> uppercase() {
|
||||
return new PostProcessingFunction<String, String>() {
|
||||
public String apply(String input) {
|
||||
return input.toUpperCase();
|
||||
return input.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
public void postProcess(Message<String> result) {
|
||||
@@ -260,7 +261,7 @@ class FunctionPostProcessingTests {
|
||||
if (input.equals("error")) {
|
||||
throw new RuntimeException("intentional");
|
||||
}
|
||||
return input.toUpperCase();
|
||||
return input.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
@@ -94,7 +95,7 @@ class GreenfieldFunctionEnableBindingTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> toUpperCase() {
|
||||
return String::toUpperCase;
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
@@ -142,7 +143,7 @@ public class HeaderTests {
|
||||
public static class FunctionMessageConfiguration {
|
||||
@Bean
|
||||
public Function<Message<String>, Message<String>> uppercase() {
|
||||
return msg -> MessageBuilder.withPayload(msg.getPayload().toUpperCase()).build();
|
||||
return msg -> MessageBuilder.withPayload(msg.getPayload().toUpperCase(Locale.ROOT)).build();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
@@ -244,7 +245,7 @@ class ImplicitFunctionBindingTests {
|
||||
// good, we expected it
|
||||
}
|
||||
|
||||
Function<byte[], String> function = v -> new String(v).toUpperCase();
|
||||
Function<byte[], String> function = v -> new String(v).toUpperCase(Locale.ROOT);
|
||||
FunctionBindingTestUtils.bind(context, function);
|
||||
|
||||
input.send(new GenericMessage<byte[]>("hello".getBytes()));
|
||||
@@ -1434,7 +1435,7 @@ class ImplicitFunctionBindingTests {
|
||||
public Function<Flux<Message<Person>>, Flux<Message<Person>>> reactivePojoMessage() {
|
||||
return flux -> flux.map(message -> {
|
||||
Person p = message.getPayload();
|
||||
p.setName(p.getName().toUpperCase());
|
||||
p.setName(p.getName().toUpperCase(Locale.ROOT));
|
||||
return MessageBuilder.withPayload(p).copyHeaders(message.getHeaders()).build();
|
||||
});
|
||||
}
|
||||
@@ -1636,7 +1637,7 @@ class ImplicitFunctionBindingTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return v -> v.toUpperCase();
|
||||
return v -> v.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -296,7 +297,7 @@ class MultipleInputOutputFunctionTests {
|
||||
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return value -> value.toUpperCase();
|
||||
return value -> value.toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -378,8 +379,8 @@ class MultipleInputOutputFunctionTests {
|
||||
@Bean
|
||||
public Function<Tuple2<Flux<Person>, Flux<Employee>>, Flux<String>> multiInputSingleOutput() {
|
||||
return tuple -> {
|
||||
Flux<String> stringStream = tuple.getT1().map(p -> p.getName().toUpperCase());
|
||||
Flux<String> intStream = tuple.getT2().map(p -> p.getName().toUpperCase());
|
||||
Flux<String> stringStream = tuple.getT1().map(p -> p.getName().toUpperCase(Locale.ROOT));
|
||||
Flux<String> intStream = tuple.getT2().map(p -> p.getName().toUpperCase(Locale.ROOT));
|
||||
return Flux.merge(stringStream, intStream);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -376,7 +377,6 @@ class RoutingFunctionTests {
|
||||
@Bean
|
||||
public Function<Message<String>, Message<String>> enrich() {
|
||||
return x -> {
|
||||
System.out.println("===> enrich");
|
||||
return MessageBuilder.withPayload(x.getPayload()).setHeader("spring.cloud.function.definition", "uppercase").build();
|
||||
};
|
||||
}
|
||||
@@ -384,8 +384,7 @@ class RoutingFunctionTests {
|
||||
@Bean
|
||||
public Function<String, String> uppercase() {
|
||||
return x -> {
|
||||
System.out.println("===> uppercase");
|
||||
return x.toUpperCase();
|
||||
return x.toUpperCase(Locale.ROOT);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.cloud.stream.function;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URI;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@@ -819,7 +820,7 @@ class StreamBridgeTests {
|
||||
public static class DynamicProducerDestinationConfig {
|
||||
@Bean
|
||||
public Function<Message<String>, Message<String>> uppercase() {
|
||||
return msg -> MessageBuilder.withPayload(msg.getPayload().toUpperCase())
|
||||
return msg -> MessageBuilder.withPayload(msg.getPayload().toUpperCase(Locale.ROOT))
|
||||
.setHeader("spring.cloud.stream.sendto.destination", "dynamicTopic").build();
|
||||
}
|
||||
}
|
||||
@@ -1003,7 +1004,7 @@ class StreamBridgeTests {
|
||||
public IntegrationFlow transform(StreamBridge bridge) {
|
||||
return IntegrationFlow.from("foo").transform(v -> {
|
||||
String s = new String((byte[]) v);
|
||||
return s.toUpperCase();
|
||||
return s.toUpperCase(Locale.ROOT);
|
||||
})
|
||||
.handle(v -> bridge.send("output", v))
|
||||
.get();
|
||||
|
||||
Reference in New Issue
Block a user