From 136ca671c83df5ba0e762eade7904070887e2270 Mon Sep 17 00:00:00 2001 From: yx9o Date: Sat, 13 Apr 2024 13:32:20 +0800 Subject: [PATCH] Refactor WhereSegmentBinderTest (#30874) --- .../binder/segment/where/WhereSegmentBinderTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/where/WhereSegmentBinderTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/where/WhereSegmentBinderTest.java index 1cd5d93a9a3cf..1e5631e768b16 100644 --- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/where/WhereSegmentBinderTest.java +++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/where/WhereSegmentBinderTest.java @@ -21,12 +21,13 @@ import org.apache.shardingsphere.infra.binder.statement.SQLStatementBinderContext; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; class WhereSegmentBinderTest { @@ -38,8 +39,8 @@ void assertBind() { Map tableBinderContexts = new HashMap<>(); Map outerTableBinderContexts = new HashMap<>(); WhereSegment actualWhereSegment = WhereSegmentBinder.bind(expectedWhereSegment, sqlStatementBinderContext, tableBinderContexts, outerTableBinderContexts); - Assertions.assertEquals(expectedWhereSegment.getStopIndex(), actualWhereSegment.getStopIndex()); - Assertions.assertEquals(expectedWhereSegment.getStartIndex(), actualWhereSegment.getStartIndex()); - Assertions.assertEquals(expectedWhereSegment.getExpr(), actualWhereSegment.getExpr()); + assertThat(actualWhereSegment.getStopIndex(), is(expectedWhereSegment.getStopIndex())); + assertThat(actualWhereSegment.getStartIndex(), is(expectedWhereSegment.getStartIndex())); + assertThat(actualWhereSegment.getExpr(), is(expectedWhereSegment.getExpr())); } }