aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-15 23:24:13 +0300
committerGravatar Vitaly Takmazov2018-03-15 23:24:13 +0300
commitef9bb70fa1fe3744e971837eb78c6c004cd1e989 (patch)
treecee55dfcdcf9daf29c4835b200e1277a5d90b101 /juick-www
parent55ec9f370d76a76aa33e290a093995d576e70bdb (diff)
boot: simplify test configuration
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/build.gradle15
-rw-r--r--juick-www/src/test/java/com/juick/www/WebAppTests.java16
2 files changed, 6 insertions, 25 deletions
diff --git a/juick-www/build.gradle b/juick-www/build.gradle
index defc6558..a48532d4 100644
--- a/juick-www/build.gradle
+++ b/juick-www/build.gradle
@@ -18,14 +18,10 @@ task compileFrontend(type: YarnTask) {
args = ['run', 'compile']
}
-apply plugin: 'java'
-apply plugin: 'war'
-apply plugin: 'org.springframework.boot'
-apply plugin: 'io.spring.dependency-management'
-
dependencies {
compile project(':juick-server-web')
compile project(':juick-server-jdbc')
+ compile ('org.springframework.boot:spring-boot-starter-security')
compile 'com.github.scribejava:scribejava-apis:5.3.0'
compile 'com.github.ooxi:serialized-php-parser:0.5.0'
compile 'com.sun.mail:javax.mail:1.6.1'
@@ -33,20 +29,13 @@ dependencies {
compile 'com.atlassian.commonmark:commonmark:0.11.0'
compile 'com.atlassian.commonmark:commonmark-ext-autolink:0.11.0'
- testCompile project(path: ':juick-core', configuration: 'testArtifacts')
- testCompile project(path: ':juick-server-web', configuration: 'testArtifacts')
- testCompile project(path: ':juick-server-jdbc', configuration: 'testArtifacts')
+ testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile ('net.sourceforge.htmlunit:htmlunit:2.29')
}
compileFrontend.dependsOn 'yarn'
processResources.dependsOn 'compileFrontend'
-compileJava.options.encoding = 'UTF-8'
bootJar {
launchScript()
}
-
-configurations {
- all*.exclude module: 'commons-logging'
-}
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;