@PostMapping("/import")
    @RequiresPermissions("system:manager:importConfig")
    public ShenyuAdminResult importConfigs(final MultipartFile file) {
        if (Objects.isNull(file)) {
            return ShenyuAdminResult.error(ShenyuResultMessage.PARAMETER_ERROR);
        }
        try {
            ShenyuAdminResult importResult = configsService.configsImport(file.getBytes());
            if (Objects.equals(CommonErrorCode.SUCCESSFUL, importResult.getCode())) {
                // sync data
                syncDataService.syncAll(DataEventTypeEnum.REFRESH);
            }
            return importResult;
        } catch (IOException e) {
            LOG.error("parsing data failed", e);
            return ShenyuAdminResult.error(ShenyuResultMessage.PARAMETER_ERROR);
        }
    }
@Test
    public void testImportConfigs() throws Exception {

        // mock import data
        List<ZipUtil.ZipItem> zipItemList = Lists.newArrayList();

        when(this.configsService.configsImport(any())).thenReturn(
                ShenyuAdminResult.success(ShenyuResultMessage.SUCCESS));

        // mock file
        MockMultipartFile file = new MockMultipartFile("file", "test.zip", MediaType.TEXT_PLAIN_VALUE, ZipUtil.zip(zipItemList));
        // Run the test
        final MockHttpServletResponse response = mockMvc.perform(multipart("/configs/import")
                        .file(file)
                        .accept(MediaType.APPLICATION_JSON))
                .andExpect(jsonPath("$.message", is(ShenyuResultMessage.SUCCESS)))
                .andExpect(status().isOk())
                .andReturn().getResponse();

        // Verify the results
        assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
    }