--- /dev/null
+package de.juplo.demo;
+
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.reactive.server.WebTestClient;
+import reactor.core.publisher.Mono;
+
+
+/**
+ * Narrow Integration-Test for the {@link RestController}.
+ * @author Kai Moritz
+ */
+@ExtendWith(SpringExtension.class)
+@WebFluxTest()
+public class RestControllerIT
+{
+ @Autowired
+ WebTestClient webClient;
+ @MockBean
+ RemoteContentService service;
+
+
+ @Test
+ @DisplayName("Valid mapping for RestController: /?path=foo")
+ void testUriWithParameter()
+ {
+ when(service.getRemoteText("foo")).thenReturn(Mono.just("bar"));
+ webClient
+ .get()
+ .uri("/?path=foo")
+ .header("Accept", MediaType.TEXT_PLAIN_VALUE)
+ .exchange()
+ .expectStatus().isOk()
+ .expectBody(String.class).isEqualTo("bar");
+ verify(service).getRemoteText("foo");
+ }
+}