puzhibing
2026-09-09 4a5e1477afc559cf870b34e4693f41d85e9580d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.ruoyi.account.controller;
 
import org.junit.jupiter.api.Test;
 
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
 
class FileControllerTest {
 
    @Test
    void managementUploadAllowsConfiguredImagesDocumentsAndFaqVideos() {
        String allowed = FileController.mergeAllowedExt("png,jpg", "pdf,doc,docx", "mp4,avi,rmvb,mov");
 
        assertTrue(FileController.isAllowedExt("png", allowed));
        assertTrue(FileController.isAllowedExt("pdf", allowed));
        assertTrue(FileController.isAllowedExt("MP4", allowed));
        assertTrue(FileController.isAllowedExt(".mov", allowed));
        assertFalse(FileController.isAllowedExt("jsp", allowed));
    }
}