use of org.apache.connect.mongo.initsync.CollectionMeta in project rocketmq-externals by apache.
the class FilterTest method testAsterisk.
@Test
public void testAsterisk() {
List<String> collections = new ArrayList<>();
collections.add("*");
insterest.put("test", collections);
sourceTaskConfig.setInterestDbAndCollection(JSONObject.toJSONString(insterest));
OperationFilter operationFilter = new OperationFilter(sourceTaskConfig);
Assert.assertTrue(operationFilter.filterMeta(new CollectionMeta("test", "testsad")));
Assert.assertTrue(operationFilter.filterMeta(new CollectionMeta("test", "tests032")));
}
use of org.apache.connect.mongo.initsync.CollectionMeta in project rocketmq-externals by apache.
the class FilterTest method testBlankDb.
@Test
public void testBlankDb() {
OperationFilter operationFilter = new OperationFilter(sourceTaskConfig);
Assert.assertTrue(operationFilter.filterMeta(new CollectionMeta("test", "test")));
Assert.assertTrue(operationFilter.filterMeta(new CollectionMeta("test1", "test01")));
}
use of org.apache.connect.mongo.initsync.CollectionMeta in project rocketmq-externals by apache.
the class FilterTest method testSpecialDb.
@Test
public void testSpecialDb() {
List<String> collections = new ArrayList<>();
collections.add("person");
insterest.put("test", collections);
sourceTaskConfig.setInterestDbAndCollection(JSONObject.toJSONString(insterest));
OperationFilter operationFilter = new OperationFilter(sourceTaskConfig);
Assert.assertTrue(operationFilter.filterMeta(new CollectionMeta("test", "person")));
Assert.assertFalse(operationFilter.filterMeta(new CollectionMeta("test", "person01")));
}
Aggregations