+ assertEquals(POLICY_1_VALID, returnedResp.getBody());
+
+ }
+
+ private String urlPutPolicy(String type, String id, String ric) {
+ return "/policy?type=" + type + "&id=" + id + "&ric=" + ric + "&service=controlpanel";
+ }
+
+ private void whenPutReturnOK(String url, String putBody, HttpStatus status, String body) {
+ ResponseEntity<String> ret = new ResponseEntity<>(body, status);
+ when(restClient.putForEntity(eq(url), eq(putBody))).thenReturn(Mono.just(ret));
+ }
+
+ private void whenPutReturnFailure(String url, String putBody, HttpStatus status, String body) {
+ HttpServerErrorException e =
+ new HttpServerErrorException(status, body, body.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8);
+ when(restClient.putForEntity(eq(url), eq(putBody))).thenReturn(Mono.error(e));