+
+ @Test
+ @DisplayName("Data not found on remote-server")
+ void testResponseNotFoud()
+ {
+ when(service.getRemoteText("foo")).thenReturn(Mono.error(exception(404)));
+
+ Mono<String> result = controller.fetch("foo");
+
+ StepVerifier
+ .create(result)
+ .expectError(NotFound.class)
+ .verify();
+ }
+
+
+ WebClientResponseException exception(int status)
+ {
+ return WebClientResponseException.create(status, "", null, null, null);
+ }