MiscController { @PutMapping("systemInfo") @ResponseStatus(HttpStatus.NO_CONTENT) public void setSystemInfo(@RequestBody SystemInfoForm json) { String info = json.getInfo(); boolean pureText = json.isPureText(); SystemInfoForm systemInfo; if (StringUtils.hasText(info)) { systemInfo = new SystemInfoForm(); systemInfo.setPureText(pureText); systemInfo.setInfo(info.trim()); } else { systemInfo = null; } systemService.setSystemInfo(systemInfo); }  @PostMapping("fix") @ResponseStatus(HttpStatus.NO_CONTENT) CompletableFuture<?> fix(); @PutMapping("systemInfo") @ResponseStatus(HttpStatus.NO_CONTENT) void setSystemInfo(@RequestBody SystemInfoForm json); @GetMapping("systemInfo") SystemInfoForm systemInfo(); @GetMapping("contestOnly") ValueHolder<Long> contestOnly(); @PutMapping("contestOnly") @ResponseStatus(HttpStatus.NO_CONTENT) void setContestOnly(@RequestBody ValueHolder<Long> form);  }
@Test public void testSetSystemInfo() throws Exception { log.info("setSystemInfo"); SystemInfoForm request = new SystemInfoForm("test", false); MvcResult result = mvc.perform(put("/api/misc/systemInfo.json") .content(objectMapper.writeValueAsString(request)).contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()) .andReturn(); }