SystemController { @GetMapping("index") public ValueHolder<String> index() { return new ValueHolder<>(systemService.getIndex()); }  @GetMapping("time") ValueHolder<Instant> time(); @GetMapping("index") ValueHolder<String> index(); @PutMapping("index") @ResponseStatus(HttpStatus.NO_CONTENT) @Secured("ROLE_ADMIN") void setIndex(@RequestBody ValueHolder<String> form);  }
@Test @WithMockUser(roles = "ADMIN") public void testIndex() throws Exception { log.info("index"); String old = getIndex(); try { String tmp = "test result"; setIndex(tmp); assertThat(getIndex()).isEqualTo(tmp); } finally { setIndex(old); } }