aboutsummaryrefslogtreecommitdiff
path: root/juick-api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-04-19 14:51:48 +0300
committerGravatar Vitaly Takmazov2017-05-05 12:06:28 +0300
commit045ca0848c8ee7c771541a5829157531c782cf30 (patch)
tree9a60049dae790fd01ace40d3757c0bfda74cd220 /juick-api
parent9345af5e39695d191b221473ce3a51b03dc09db3 (diff)
juick-www: Home controller uses Pebble, drop ads
wip
Diffstat (limited to 'juick-api')
-rw-r--r--juick-api/src/main/java/com/juick/api/ApiServer.java3
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java11
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java6
-rw-r--r--juick-api/src/test/java/com/juick/api/tests/MessagesTests.java6
4 files changed, 10 insertions, 16 deletions
diff --git a/juick-api/src/main/java/com/juick/api/ApiServer.java b/juick-api/src/main/java/com/juick/api/ApiServer.java
index b59010b3..097dda58 100644
--- a/juick-api/src/main/java/com/juick/api/ApiServer.java
+++ b/juick-api/src/main/java/com/juick/api/ApiServer.java
@@ -17,12 +17,9 @@
*/
package com.juick.api;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.env.Environment;
import rocks.xmpp.core.XmppException;
import rocks.xmpp.core.session.Extension;
import rocks.xmpp.core.session.XmppSessionConfiguration;
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
index e987893d..b6ba9282 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
@@ -1,15 +1,9 @@
package com.juick.api.configuration;
-import com.juick.api.ApiServer;
-import com.juick.api.MessengerBot;
import com.juick.api.TGBot;
-import com.pengrad.telegrambot.TelegramBot;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
-import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.socket.client.WebSocketConnectionManager;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
@@ -26,11 +20,6 @@ public class ApiAppConfiguration {
@Inject
TGBot tgBot;
- @Bean
- public ApiServer apiServer() {
- return new ApiServer();
- }
-
private static final String WS_URI = "wss://ws.juick.com/";
@Bean
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
index 37c07434..adff42a7 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java
@@ -2,6 +2,7 @@ package com.juick.api.configuration;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+import com.juick.api.ApiServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@@ -22,6 +23,11 @@ import java.util.List;
@ComponentScan(basePackages = {"com.juick.api.controllers"})
public class ApiMvcConfiguration extends WebMvcConfigurationSupport {
+ @Bean
+ public ApiServer apiServer() {
+ return new ApiServer();
+ }
+
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
RequestMappingHandlerMapping mapping = super.requestMappingHandlerMapping();
diff --git a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java
index 61d1b008..af1e49a4 100644
--- a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java
+++ b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java
@@ -3,9 +3,10 @@ package com.juick.api.tests;
import com.juick.Message;
import com.juick.Tag;
import com.juick.User;
-import com.juick.api.configuration.ApiAppConfiguration;
import com.juick.api.configuration.ApiMvcConfiguration;
import com.juick.api.configuration.ApiSecurityConfig;
+import com.juick.api.configuration.MessengerConfiguration;
+import com.juick.api.configuration.TelegramConfiguration;
import com.juick.configuration.MockDataConfiguration;
import com.juick.server.helpers.TagStats;
import com.juick.service.MessagesService;
@@ -44,7 +45,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@WebAppConfiguration
public class MessagesTests {
@Configuration
- @Import(value = {ApiMvcConfiguration.class, ApiAppConfiguration.class, ApiSecurityConfig.class, MockDataConfiguration.class})
+ @Import(value = {ApiMvcConfiguration.class, ApiSecurityConfig.class,
+ MockDataConfiguration.class, MessengerConfiguration.class, TelegramConfiguration.class})
static class Config {}
private MockMvc mockMvc;