aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-22 10:54:42 +0300
committerGravatar Vitaly Takmazov2018-02-22 10:54:42 +0300
commit0a47022611e9ade7b4cf04e8d2783e966610e136 (patch)
tree76a366b8d658be9374639aedfb4d7d0add57f389 /juick-server/src/main/java/com/juick
parentdbc14ee4919b2f536a4afadba71ba8eb41290eb1 (diff)
server and tests now runnable without config
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/server/CrosspostManager.java4
-rw-r--r--juick-server/src/main/java/com/juick/server/TelegramBotManager.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPBot.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPServer.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java4
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/ApiInitializer.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java2
7 files changed, 8 insertions, 11 deletions
diff --git a/juick-server/src/main/java/com/juick/server/CrosspostManager.java b/juick-server/src/main/java/com/juick/server/CrosspostManager.java
index 1752e1ca..631e98ae 100644
--- a/juick-server/src/main/java/com/juick/server/CrosspostManager.java
+++ b/juick-server/src/main/java/com/juick/server/CrosspostManager.java
@@ -53,9 +53,9 @@ public class CrosspostManager implements ApplicationListener<MessageEvent> {
@Inject
private CrosspostService crosspostService;
- @Value("${twitter_consumer_key:}")
+ @Value("${twitter_consumer_key:12345678}")
private String twitter_consumer_key;
- @Value("${twitter_consumer_secret:}")
+ @Value("${twitter_consumer_secret:secret}")
private String twitter_consumer_secret;
@Override
diff --git a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
index 5743a15e..0d765b71 100644
--- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
+++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
@@ -70,7 +70,7 @@ public class TelegramBotManager implements ApplicationListener<MessageEvent> {
private TelegramBot bot;
- @Value("${telegram_token}")
+ @Value("${telegram_token:12345678}")
private String telegramToken;
@Inject
private TelegramService telegramService;
diff --git a/juick-server/src/main/java/com/juick/server/XMPPBot.java b/juick-server/src/main/java/com/juick/server/XMPPBot.java
index 46a83777..1c17a0aa 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPBot.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPBot.java
@@ -60,7 +60,7 @@ public class XMPPBot implements StanzaListener, AutoCloseable {
private XMPPServer xmpp;
@Inject
private XMPPConnection router;
- @Value("${xmppbot_jid}")
+ @Value("${xmppbot_jid:juick@localhost}")
private Jid jid;
private PrettyTime pt;
diff --git a/juick-server/src/main/java/com/juick/server/XMPPServer.java b/juick-server/src/main/java/com/juick/server/XMPPServer.java
index 7562d265..358860f7 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPServer.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPServer.java
@@ -63,7 +63,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
@Inject
public ExecutorService service;
- @Value("${hostname}")
+ @Value("${hostname:localhost}")
private Jid jid;
@Value("${s2s_port:5269}")
private int s2sPort;
diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
index db9dab17..146e277c 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/ApiAppConfiguration.java
@@ -68,7 +68,7 @@ import java.util.concurrent.Executors;
@EnableSwagger2
@EnableScheduling
@EnableWebSocket
-@PropertySource("classpath:juick.conf")
+@PropertySource(value = "classpath:juick.conf", ignoreResourceNotFound = true)
@ComponentScan(basePackages = "com.juick.server")
public class ApiAppConfiguration extends BaseWebConfiguration implements WebSocketConfigurer {
@Inject
@@ -132,7 +132,7 @@ public class ApiAppConfiguration extends BaseWebConfiguration implements WebSock
container.setMaxBinaryMessageBufferSize(8192);
return container;
}
- @Value("${hostname}")
+ @Value("${hostname:localhost}")
private String hostname;
@Bean
diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiInitializer.java b/juick-server/src/main/java/com/juick/server/configuration/ApiInitializer.java
index b25edd9a..b789fc50 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/ApiInitializer.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/ApiInitializer.java
@@ -18,8 +18,6 @@
package com.juick.server.configuration;
import com.juick.configuration.DataConfiguration;
-import com.juick.server.configuration.JuickServerWebsocketConfiguration;
-import com.juick.server.configuration.StorageConfiguration;
import org.apache.commons.codec.CharEncoding;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@@ -35,6 +33,7 @@ public class ApiInitializer extends AbstractAnnotationConfigDispatcherServletIni
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{
+ ApiAppConfiguration.class,
ApiSecurityConfig.class,
DataConfiguration.class,
StorageConfiguration.class
diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
index ed79c5f1..58fd4231 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java
@@ -48,8 +48,6 @@ import java.util.concurrent.TimeUnit;
*/
@Configuration
@EnableWebSecurity
-@PropertySource("classpath:juick.conf")
-@Import(ApiAppConfiguration.class)
public class ApiSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${auth_remember_me_key}")
private String rememberMeKey;