- String errorCause = "Refused";
- doReturn(Mono.error(new Exception(errorCause))).when(agentClient).put(anyString(), any());
+ WebClientResponseException except = new WebClientResponseException(400, "Refused", null, null, null, null);
+ doReturn(Mono.error(except)).when(agentClient).putForEntity(anyString(), any());