pandaapo commented on code in PR #4522: URL: https://github.com/apache/eventmesh/pull/4522#discussion_r1398196637
########## eventmesh-connectors/eventmesh-connector-feishu/src/test/java/org/apache/eventmesh/connector/s3/source/FeishuSinkConnectorTest.java: ########## @@ -0,0 +1,99 @@ +/* + * 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. + */ + +package org.apache.eventmesh.connector.s3.source; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +import org.apache.eventmesh.connector.feishu.sink.config.FeishuSinkConfig; +import org.apache.eventmesh.connector.feishu.sink.config.SinkConnectorConfig; +import org.apache.eventmesh.connector.feishu.sink.connector.FeishuSinkConnector; +import org.apache.eventmesh.openconnect.offsetmgmt.api.data.ConnectRecord; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.platform.commons.support.HierarchyTraversalMode; +import org.junit.platform.commons.support.ReflectionSupport; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.Spy; +import org.mockito.junit.jupiter.MockitoExtension; + +import com.lark.oapi.Client; +import com.lark.oapi.core.response.RawResponse; + +@ExtendWith(MockitoExtension.class) +public class FeishuSinkConnectorTest { + + private static final FeishuSinkConfig sinkConfig; + + private static final SinkConnectorConfig SINK_CONNECTOR_CONFIG; + + static { + sinkConfig = new FeishuSinkConfig(); + SINK_CONNECTOR_CONFIG = new SinkConnectorConfig(); + SINK_CONNECTOR_CONFIG.setConnectorName("FeishuSinkConnector"); + SINK_CONNECTOR_CONFIG.setAppId("xxx"); + SINK_CONNECTOR_CONFIG.setAppSecret("xxx"); + SINK_CONNECTOR_CONFIG.setReceiveId("xxx"); + SINK_CONNECTOR_CONFIG.setReceiveIdType("open_id"); + sinkConfig.setConnectorConfig(SINK_CONNECTOR_CONFIG); + } + + @Spy + private FeishuSinkConnector feishuSinkConnector; Review Comment: The `@Spy` annotation is not very meaningful here, because you are not stubbing the object at all. You are basically constructing it manually. 这个`@Spy`注解意义不大,因为您没有对该对象进行任何打桩,基本上是手动构建的。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
