@PostMapping("")
    @RequiresPermissions(value = {"system:dict:add", "system:dict:edit"}, logical = Logical.OR)
    public ShenyuAdminResult createShenyuDict(@Valid @RequestBody final ShenyuDictDTO shenyuDictDTO) {
        return ShenyuAdminResult.success(ShenyuResultMessage.CREATE_SUCCESS, shenyuDictService.createOrUpdate(shenyuDictDTO));
    }
@Test
    public void testCreateShenyuDict() throws Exception {
        ShenyuDictDTO shenyuDictDTO = buildTestDict();
        
        SpringBeanUtils.getInstance().setApplicationContext(mock(ConfigurableApplicationContext.class));
        when(SpringBeanUtils.getInstance().getBean(ShenyuDictMapper.class)).thenReturn(shenyuDictMapper);
        when(shenyuDictMapper.existed(shenyuDictDTO.getId())).thenReturn(true);
        
        given(this.shenyuDictService.createOrUpdate(shenyuDictDTO)).willReturn(1);
        this.mockMvc.perform(MockMvcRequestBuilders.post("/shenyu-dict/")
                .contentType(MediaType.APPLICATION_JSON)
                .content(GsonUtils.getInstance().toJson(shenyuDictDTO)))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.message", is(ShenyuResultMessage.CREATE_SUCCESS)))
                .andReturn();
    }