You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by to...@apache.org on 2023/04/06 01:36:14 UTC
[shardingsphere] branch master updated: Use assertThat to instead of assertEquals (#25017)
This is an automated email from the ASF dual-hosted git repository.
totalo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new bb642cb5c60 Use assertThat to instead of assertEquals (#25017)
bb642cb5c60 is described below
commit bb642cb5c60bdaf833191be77b9bcc94f72e11a9
Author: yx9o <ya...@163.com>
AuthorDate: Thu Apr 6 09:36:04 2023 +0800
Use assertThat to instead of assertEquals (#25017)
* Use assertThat to instead of assertEquals
* Update
---
.../data/pipeline/cdc/client/util/ProtobufAnyValueConverterTest.java | 3 +--
.../data/pipeline/core/context/PipelineContextKeyTest.java | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/kernel/data-pipeline/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverterTest.java b/kernel/data-pipeline/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverterTest.java
index 01e91493dad..ee6f19f6310 100644
--- a/kernel/data-pipeline/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverterTest.java
+++ b/kernel/data-pipeline/cdc/client/src/test/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverterTest.java
@@ -40,7 +40,6 @@ import java.time.OffsetDateTime;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
class ProtobufAnyValueConverterTest {
@@ -70,6 +69,6 @@ class ProtobufAnyValueConverterTest {
.putFields("list", Value.newBuilder().setListValue(ListValue.newBuilder().addValues(Value.newBuilder().setNumberValue(1)).build()).build()).build();
Builder expected = Struct.newBuilder();
JsonFormat.parser().merge((String) ProtobufAnyValueConverter.convertToObject(Any.pack((Struct) actual)), expected);
- assertEquals(actual.toString(), expected.toString());
+ assertThat(actual.toString(), is(expected.toString()));
}
}
diff --git a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/context/PipelineContextKeyTest.java b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/context/PipelineContextKeyTest.java
index 3424a591cf8..3f0811b4957 100644
--- a/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/context/PipelineContextKeyTest.java
+++ b/kernel/data-pipeline/core/src/test/java/org/apache/shardingsphere/data/pipeline/core/context/PipelineContextKeyTest.java
@@ -22,18 +22,17 @@ import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-final class PipelineContextKeyTest {
+class PipelineContextKeyTest {
@Test
void assertHashCodeEqualsForProxyMode() {
PipelineContextKey contextKey1 = PipelineContextKey.build(InstanceType.PROXY, null);
PipelineContextKey contextKey2 = PipelineContextKey.build(InstanceType.PROXY, "sharding_db");
assertThat(contextKey1.hashCode(), is(contextKey2.hashCode()));
- assertEquals(contextKey1, contextKey2);
+ assertThat(contextKey1, is(contextKey2));
}
@Test