diff options
author | Vitaly Takmazov | 2018-03-15 23:24:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-03-15 23:24:13 +0300 |
commit | ef9bb70fa1fe3744e971837eb78c6c004cd1e989 (patch) | |
tree | cee55dfcdcf9daf29c4835b200e1277a5d90b101 /juick-www/src/test | |
parent | 55ec9f370d76a76aa33e290a093995d576e70bdb (diff) |
boot: simplify test configuration
Diffstat (limited to 'juick-www/src/test')
-rw-r--r-- | juick-www/src/test/java/com/juick/www/WebAppTests.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/juick-www/src/test/java/com/juick/www/WebAppTests.java b/juick-www/src/test/java/com/juick/www/WebAppTests.java index 73cec17a..7aa0a515 100644 --- a/juick-www/src/test/java/com/juick/www/WebAppTests.java +++ b/juick-www/src/test/java/com/juick/www/WebAppTests.java @@ -27,7 +27,6 @@ import com.juick.Message; import com.juick.Tag; import com.juick.User; import com.juick.configuration.DataConfiguration; -import com.juick.configuration.RepositoryConfiguration; import com.juick.service.*; import com.juick.util.MessageUtils; import com.juick.www.configuration.SapeConfiguration; @@ -44,9 +43,9 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.autoconfigure.web.client.AutoConfigureWebClient; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; @@ -80,7 +79,6 @@ import java.util.stream.StreamSupport; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; -import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -95,17 +93,11 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @ContextConfiguration(classes = { DataConfiguration.class, WwwServletConfiguration.class, WwwAppConfiguration.class, SapeConfiguration.class, - RepositoryConfiguration.class, WebSecurityConfig.class + WebSecurityConfig.class }) public class WebAppTests { - @Configuration - static class Config { - @Bean - public ImagesService imagesService() { - return new MockImagesService(); - } - } - + @MockBean + private ImagesService imagesService; @Inject private WebApp webApp; |