lucaspeng12138 commented on code in PR #5989: URL: https://github.com/apache/inlong/pull/5989#discussion_r980686815
########## inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/sink/DorisSinkServiceTest.java: ########## @@ -0,0 +1,100 @@ +/* + * 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.inlong.manager.service.sink; + +import org.apache.inlong.manager.common.consts.InlongConstants; +import org.apache.inlong.manager.common.consts.SinkType; +import org.apache.inlong.manager.pojo.sink.SinkRequest; +import org.apache.inlong.manager.pojo.sink.StreamSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSinkRequest; +import org.apache.inlong.manager.service.ServiceBaseTest; +import org.apache.inlong.manager.service.core.impl.InlongStreamServiceTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Doris sink service test + */ +public class DorisSinkServiceTest extends ServiceBaseTest { + + // Partial test data + private static final String globalGroupId = "b_group1"; + private static final String globalStreamId = "stream1_doris"; + private static final String globalOperator = "admin"; + private static final String dorisJdbcUrl = "jdbc:mysql://127.0.0.1:6603/default"; + private static final String dorisUsername = "doris_user"; + private static final String dorisPassword = "doris_passwd"; + private static final String dorisTableName = "doris_tbl"; + @Autowired + private StreamSinkService sinkService; + @Autowired + private InlongStreamServiceTest streamServiceTest; + + /** + * Save sink info. + */ + public Integer saveSink(String sinkName) { + streamServiceTest.saveInlongStream(globalGroupId, globalStreamId, globalOperator); + DorisSinkRequest sinkInfo = new DorisSinkRequest(); Review Comment: resolved ########## inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/sink/DorisSinkServiceTest.java: ########## @@ -0,0 +1,100 @@ +/* + * 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.inlong.manager.service.sink; + +import org.apache.inlong.manager.common.consts.InlongConstants; +import org.apache.inlong.manager.common.consts.SinkType; +import org.apache.inlong.manager.pojo.sink.SinkRequest; +import org.apache.inlong.manager.pojo.sink.StreamSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSinkRequest; +import org.apache.inlong.manager.service.ServiceBaseTest; +import org.apache.inlong.manager.service.core.impl.InlongStreamServiceTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Doris sink service test + */ +public class DorisSinkServiceTest extends ServiceBaseTest { + + // Partial test data + private static final String globalGroupId = "b_group1"; + private static final String globalStreamId = "stream1_doris"; + private static final String globalOperator = "admin"; + private static final String dorisJdbcUrl = "jdbc:mysql://127.0.0.1:6603/default"; + private static final String dorisUsername = "doris_user"; + private static final String dorisPassword = "doris_passwd"; + private static final String dorisTableName = "doris_tbl"; + @Autowired + private StreamSinkService sinkService; + @Autowired + private InlongStreamServiceTest streamServiceTest; + + /** + * Save sink info. + */ + public Integer saveSink(String sinkName) { + streamServiceTest.saveInlongStream(globalGroupId, globalStreamId, globalOperator); + DorisSinkRequest sinkInfo = new DorisSinkRequest(); + sinkInfo.setInlongGroupId(globalGroupId); + sinkInfo.setInlongStreamId(globalStreamId); + sinkInfo.setSinkName(sinkName); + sinkInfo.setSinkType(SinkType.DORIS); + sinkInfo.setJdbcUrl(dorisJdbcUrl); + sinkInfo.setUsername(dorisUsername); + sinkInfo.setPassword(dorisPassword); + sinkInfo.setTableName(dorisTableName); + sinkInfo.setEnableCreateResource(InlongConstants.DISABLE_CREATE_RESOURCE); + sinkInfo.setId((int) (Math.random() * 100000 + 1)); Review Comment: resolved ########## inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/sink/DorisSinkServiceTest.java: ########## @@ -0,0 +1,100 @@ +/* + * 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.inlong.manager.service.sink; + +import org.apache.inlong.manager.common.consts.InlongConstants; +import org.apache.inlong.manager.common.consts.SinkType; +import org.apache.inlong.manager.pojo.sink.SinkRequest; +import org.apache.inlong.manager.pojo.sink.StreamSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSink; +import org.apache.inlong.manager.pojo.sink.doris.DorisSinkRequest; +import org.apache.inlong.manager.service.ServiceBaseTest; +import org.apache.inlong.manager.service.core.impl.InlongStreamServiceTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * Doris sink service test + */ +public class DorisSinkServiceTest extends ServiceBaseTest { + + // Partial test data + private static final String globalGroupId = "b_group1"; Review Comment: resolved -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org