@Test public void testDelete() { webClient.post().uri("/users/delete?id=1") .exchange() .expectStatus().isOk() .expectBody(Boolean.class) .isEqualTo(true); }
@PostMapping("/delete") public Mono<Boolean> delete(@RequestParam("id") Integer id) { Boolean success = true; return Mono.just(success); }
UserController { @PostMapping("/delete") public Mono<Boolean> delete(@RequestParam("id") Integer id) { Boolean success = true; return Mono.just(success); } }
UserController { @PostMapping("/delete") public Mono<Boolean> delete(@RequestParam("id") Integer id) { Boolean success = true; return Mono.just(success); }  }
UserController { @PostMapping("/delete") public Mono<Boolean> delete(@RequestParam("id") Integer id) { Boolean success = true; return Mono.just(success); }  @GetMapping("/list") Flux<UserVO> list(); @GetMapping("/get") Mono<UserVO> get(@RequestParam("id") Integer id); @GetMapping("/v2/get") Mono<UserVO> get2(@RequestParam("id") Integer id); @PostMapping("add") Mono<Integer> add(@RequestBody Publisher<UserAddDTO> addDTO); @PostMapping("add2") Mono<Integer> add2(Mono<UserAddDTO> addDTO); @PostMapping("/update") Mono<Boolean> update(@RequestBody Publisher<UserUpdateDTO> updateDTO); @PostMapping("/delete") // URL 修改成 /delete ，RequestMethod 改成 DELETE Mono<Boolean> delete(@RequestParam("id") Integer id); }
UserController { @PostMapping("/delete") public Mono<Boolean> delete(@RequestParam("id") Integer id) { Boolean success = true; return Mono.just(success); }  @GetMapping("/list") Flux<UserVO> list(); @GetMapping("/get") Mono<UserVO> get(@RequestParam("id") Integer id); @GetMapping("/v2/get") Mono<UserVO> get2(@RequestParam("id") Integer id); @PostMapping("add") Mono<Integer> add(@RequestBody Publisher<UserAddDTO> addDTO); @PostMapping("add2") Mono<Integer> add2(Mono<UserAddDTO> addDTO); @PostMapping("/update") Mono<Boolean> update(@RequestBody Publisher<UserUpdateDTO> updateDTO); @PostMapping("/delete") // URL 修改成 /delete ，RequestMethod 改成 DELETE Mono<Boolean> delete(@RequestParam("id") Integer id);  }