From e009a26c18e473ae45d75e47966c479dbe138ad4 Mon Sep 17 00:00:00 2001 From: yanrongzhen Date: Thu, 26 Oct 2023 13:44:10 +0800 Subject: [PATCH] remove hamcrest dep. --- .../eventmesh-connector-spring/build.gradle | 1 - .../connector/SpringSinkConnectorTest.java | 9 ++++---- gradle/libs.versions.toml | 22 ------------------- 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 gradle/libs.versions.toml diff --git a/eventmesh-connectors/eventmesh-connector-spring/build.gradle b/eventmesh-connectors/eventmesh-connector-spring/build.gradle index 5e2570039e..b6f63cbfdd 100644 --- a/eventmesh-connectors/eventmesh-connector-spring/build.gradle +++ b/eventmesh-connectors/eventmesh-connector-spring/build.gradle @@ -33,5 +33,4 @@ dependencies { testImplementation "org.mockito:mockito-core" testImplementation "org.mockito:mockito-junit-jupiter" - testImplementation libs.hamcrest } \ No newline at end of file diff --git a/eventmesh-connectors/eventmesh-connector-spring/src/test/java/org/apache/eventmesh/connector/spring/sink/connector/SpringSinkConnectorTest.java b/eventmesh-connectors/eventmesh-connector-spring/src/test/java/org/apache/eventmesh/connector/spring/sink/connector/SpringSinkConnectorTest.java index 96b4946ecb..ea0ea7c359 100644 --- a/eventmesh-connectors/eventmesh-connector-spring/src/test/java/org/apache/eventmesh/connector/spring/sink/connector/SpringSinkConnectorTest.java +++ b/eventmesh-connectors/eventmesh-connector-spring/src/test/java/org/apache/eventmesh/connector/spring/sink/connector/SpringSinkConnectorTest.java @@ -17,8 +17,6 @@ package org.apache.eventmesh.connector.spring.sink.connector; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertNotNull; import org.apache.eventmesh.connector.spring.sink.config.SpringSinkConfig; @@ -30,6 +28,7 @@ import java.util.List; import java.util.concurrent.BlockingQueue; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -51,7 +50,7 @@ public void setUp() throws Exception { @Test public void testSinkConnectorRunning() { - assertThat(connector.isRunning(), is(true)); + Assertions.assertTrue(connector.isRunning()); } @Test @@ -60,12 +59,12 @@ public void testProcessRecordsInSinkConnectorQueue() throws Exception { final String message = "testMessage"; writeMockedRecords(count, message); BlockingQueue queue = connector.getQueue(); - assertThat(count, is(queue.size())); + Assertions.assertEquals(count, queue.size()); for (int i = 0; i < count; i++) { ConnectRecord poll = queue.poll(); assertNotNull(poll); String expectedMessage = message + i; - assertThat(poll.getData(), is(expectedMessage)); + Assertions.assertEquals(poll.getData(), expectedMessage); } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml deleted file mode 100644 index 8ff5a3d334..0000000000 --- a/gradle/libs.versions.toml +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -[versions] -hamcrest = "2.2" - -[libraries] -hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } \ No newline at end of file