WangHan
2024-09-12 d5855a4926926698b740bc6c7ba489de47adb68b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package tech.powerjob.server.persistence.storage.impl;
 
import lombok.extern.slf4j.Slf4j;
import tech.powerjob.server.common.utils.TestUtils;
import tech.powerjob.server.extension.dfs.DFsService;
 
import java.util.Optional;
 
/**
 * test GridFS
 *
 * @author tjq
 * @since 2023/7/30
 */
@Slf4j
class GridFsServiceTest extends AbstractDfsServiceTest {
 
    @Override
    protected Optional<DFsService> fetchService() {
 
        Object mongoUri = TestUtils.fetchTestConfig().get(TestUtils.KEY_MONGO_URI);
 
        if (mongoUri == null) {
            log.info("[GridFsServiceTest] mongoUri is null, skip load!");
            return Optional.empty();
        }
 
        GridFsService gridFsService = new GridFsService();
        gridFsService.initMongo(String.valueOf(mongoUri));
        return Optional.of(gridFsService);
    }
}