@@ -0,0 +1,2378 @@
+/*%0A * Copyright 2017 ZJNU ACM.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage cn.edu.zjnu.acm.judge.config;%0A%0Aimport cn.edu.zjnu.acm.judge.Application;%0Aimport com.github.zhanhb.ckfinder.connector.autoconfigure.CKFinderProperties;%0Aimport javax.servlet.Filter;%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.web.context.WebApplicationContext;%0A%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;%0Aimport static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;%0A%0A/**%0A *%0A * @author zhanhb%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@Slf4j%0A@SpringBootTest(classes = Application.class)%0A@WebAppConfiguration%0Apublic class CKFinderTest %7B%0A%0A    @Autowired%0A    private WebApplicationContext context;%0A    @Autowired%0A    private CKFinderProperties properties;%0A    @Autowired%0A    private Filter%5B%5D filters;%0A%0A    @Test%0A    public void test() throws Exception %7B%0A        log.info(%22filters: %7B%7D%22, (Object) filters);%0A        MockMvc mvc = webAppContextSetup(context).addFilters(filters).build();%0A        String%5B%5D path = properties.getServlet().getPath();%0A        for (String string : path) %7B%0A            mvc.perform(get(string))%0A                    .andDo(print())%0A                    .andExpect(forwardedUrl(%22/unauthorized%22));%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Add test