@Operation(summary = "createAlertPluginInstance", description = "CREATE_ALERT_PLUGIN_INSTANCE_NOTES")
    @Parameters({
            @Parameter(name = "pluginDefineId", description = "ALERT_PLUGIN_DEFINE_ID", required = true, schema = @Schema(implementation = int.class, example = "100")),
            @Parameter(name = "instanceName", description = "ALERT_PLUGIN_INSTANCE_NAME", required = true, schema = @Schema(implementation = String.class, example = "DING TALK")),
            @Parameter(name = "pluginInstanceParams", description = "ALERT_PLUGIN_INSTANCE_PARAMS", required = true, schema = @Schema(implementation = String.class, example = "ALERT_PLUGIN_INSTANCE_PARAMS"))
    })
    @PostMapping()
    @ResponseStatus(HttpStatus.CREATED)
    @ApiException(CREATE_ALERT_PLUGIN_INSTANCE_ERROR)
    public Result<AlertPluginInstance> createAlertPluginInstance(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                                                                 @RequestParam(value = "pluginDefineId") int pluginDefineId,
                                                                 @RequestParam(value = "instanceName") String instanceName,
                                                                 @RequestParam(value = "instanceType") AlertPluginInstanceType instanceType,
                                                                 @RequestParam(value = "warningType") WarningType warningType,
                                                                 @RequestParam(value = "pluginInstanceParams") String pluginInstanceParams) {
        AlertPluginInstance alertPluginInstance = alertPluginInstanceService.create(loginUser, pluginDefineId,
                instanceName, instanceType, warningType, pluginInstanceParams);
        return Result.success(alertPluginInstance);
    }
@Test
    public void testCreateAlertPluginInstance() throws Exception {
        // Given
        final MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
        paramsMap.add("pluginDefineId", String.valueOf(pluginDefineId));
        paramsMap.add("instanceName", instanceName);
        paramsMap.add("instanceType", pluginInstanceType.getDescp());
        paramsMap.add("warningType", warningType.name());
        paramsMap.add("pluginInstanceParams", pluginInstanceParams);

        when(alertPluginInstanceService.create(any(User.class), eq(pluginDefineId), eq(instanceName),
                eq(pluginInstanceType), eq(warningType), eq(pluginInstanceParams))).thenReturn(null);

        // When
        final MvcResult mvcResult = mockMvc.perform(post("/alert-plugin-instances")
                .header(SESSION_ID, sessionId)
                .params(paramsMap))
                .andExpect(status().isCreated())
                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
                .andReturn();

        // Then
        final Result actualResponseContent =
                JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
        assertThat(actualResponseContent.getMsg()).isEqualTo(expectResponseContent.getMsg());
        assertThat(actualResponseContent.getCode()).isEqualTo(expectResponseContent.getCode());
    }