MiscController { @PutMapping("contestOnly") @ResponseStatus(HttpStatus.NO_CONTENT) public void setContestOnly(@RequestBody ValueHolder<Long> form) { contestOnlyService.setContestOnly(form.getValue()); }  @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 testContestOnly() throws Exception { log.info("getContestOnly"); Long old = getContestOnly(); try { setContestOnly(null); assertThat(getContestOnly()).isNull(); request(HttpStatus.OK); setContestOnly(Long.MIN_VALUE); assertThat(getContestOnly()).isEqualTo(Long.valueOf(Long.MIN_VALUE)); request(HttpStatus.FORBIDDEN); setContestOnly(Long.MIN_VALUE); request(HttpStatus.FORBIDDEN); assertThat(getContestOnly()).isEqualTo(Long.valueOf(Long.MIN_VALUE)); setContestOnly(null); request(HttpStatus.OK); assertThat(getContestOnly()).isEqualTo(null); } finally { setContestOnly(old); } }