From: Kai Moritz Date: Sat, 11 Jan 2020 15:23:41 +0000 (+0100) Subject: WIP:BAD X-Git-Tag: tmp~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=f8e4ee110890babac9598a137d92931d3315dbaa;p=demos%2Ftesting WIP:BAD --- diff --git a/src/test/java/de/juplo/demo/RemoteContentServiceTest.java b/src/test/java/de/juplo/demo/RemoteContentServiceTest.java index b3f4e8a..e458479 100644 --- a/src/test/java/de/juplo/demo/RemoteContentServiceTest.java +++ b/src/test/java/de/juplo/demo/RemoteContentServiceTest.java @@ -1,12 +1,13 @@ package de.juplo.demo; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; -import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec; import org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec; @@ -19,21 +20,28 @@ import reactor.test.StepVerifier; * Unit-Test for class {@link RemoteContentService}. * @author Kai Moritz */ -@ExtendWith(MockitoExtension.class) +@ExtendWith(SpringExtension.class) public class RemoteContentServiceTest { RemoteContentService service; @MockBean WebClient webClient; - @MockBean + @MockBean(name = "uriSpec") RequestHeadersUriSpec uriSpec; - @MockBean + @MockBean(name = "headersSpec") RequestHeadersSpec headersSpec; - @MockBean + @MockBean(name = "responseSpec") ResponseSpec responseSpec; + @BeforeEach + void setUp() + { + service = new RemoteContentService(webClient); + } + + @Test void test() {