Fix failing tests
See gh-26746
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
@@ -89,8 +90,12 @@ public abstract class AbstractDataBufferAllocatingTests {
|
||||
}
|
||||
|
||||
protected Consumer<DataBuffer> stringConsumer(String expected) {
|
||||
return stringConsumer(expected, UTF_8);
|
||||
}
|
||||
|
||||
protected Consumer<DataBuffer> stringConsumer(String expected, Charset charset) {
|
||||
return dataBuffer -> {
|
||||
String value = dataBuffer.toString(UTF_8);
|
||||
String value = dataBuffer.toString(charset);
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
assertThat(value).isEqualTo(expected);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user