Skip to content

Commit 35e85ea

Browse files
sunxiaojianfhussonnois
authored andcommitted
add test case for AliyunOSSURI
1 parent dec3ba6 commit 35e85ea

File tree

1 file changed

+39
-0
lines changed
  • connect-file-pulse-filesystems/filepulse-aliyunoss-fs/src/test/java/io/streamthoughts/kafka/connect/filepulse/fs

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2023 StreamThoughts.
3+
*
4+
* Licensed to the Apache Software Foundation (ASF) under one or more
5+
* contributor license agreements. See the NOTICE file distributed with
6+
* this work for additional information regarding copyright ownership.
7+
* The ASF licenses this file to You under the Apache License, Version 2.0
8+
* (the "License"); you may not use this file except in compliance with
9+
* the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
package io.streamthoughts.kafka.connect.filepulse.fs;
21+
22+
import io.streamthoughts.kafka.connect.filepulse.fs.utils.AliyunOSSURI;
23+
import org.junit.Assert;
24+
import org.junit.Test;
25+
26+
import java.net.URI;
27+
28+
public class AliyunOSSURITest {
29+
30+
@Test
31+
public void testAll() {
32+
OSSBucketKey source = new OSSBucketKey("bucket", "/path/to/object/text.csv");
33+
URI uri = source.toURI();
34+
AliyunOSSURI aliyunOSSURI = new AliyunOSSURI(uri);
35+
Assert.assertEquals("bucket", aliyunOSSURI.getBucket());
36+
Assert.assertEquals("/path/to/object/text.csv", aliyunOSSURI.getKey());
37+
}
38+
39+
}

0 commit comments

Comments
 (0)