From f8e4ee110890babac9598a137d92931d3315dbaa Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 11 Jan 2020 16:23:41 +0100 Subject: [PATCH] WIP:BAD --- .../juplo/demo/RemoteContentServiceTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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() { -- 2.20.1