From 0a47022611e9ade7b4cf04e8d2783e966610e136 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Feb 2018 10:54:42 +0300 Subject: server and tests now runnable without config --- .../src/main/java/com/juick/www/configuration/WebSecurityConfig.java | 2 +- .../main/java/com/juick/www/configuration/WwwAppConfiguration.java | 2 +- .../java/com/juick/www/configuration/WwwServletConfiguration.java | 1 - juick-www/src/main/java/com/juick/www/controllers/NewMessage.java | 4 ++-- juick-www/src/test/java/com/juick/www/WebAppTests.java | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) (limited to 'juick-www') diff --git a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java index 613b4c92..bde85ee4 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java @@ -43,7 +43,7 @@ import javax.annotation.Resource; public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Value("${auth_remember_me_key}") private String rememberMeKey; - @Value("${web_domain:juick.com}") + @Value("${web_domain:localhost}") private String webDomain; @Resource private UserService userService; diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java index 205c0627..c30f5a92 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwAppConfiguration.java @@ -45,7 +45,7 @@ import java.util.HashMap; * Created by aalexeev on 11/22/16. */ @Configuration -@PropertySource("classpath:juick.conf") +@PropertySource(value = "classpath:juick.conf", ignoreResourceNotFound = true) @EnableCaching public class WwwAppConfiguration { @Inject diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java index e5119f4f..60a3b9cc 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java @@ -46,7 +46,6 @@ import java.util.concurrent.TimeUnit; */ @Configuration @ComponentScan(basePackages = {"com.juick.www"}) -@PropertySource("classpath:juick.conf") @EnableWebMvc public class WwwServletConfiguration extends BaseWebConfiguration { diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java index 8cf70291..e652b4d5 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java @@ -68,9 +68,9 @@ public class NewMessage { private PMQueriesService pmQueriesService; @Inject private WebApp webApp; - @Value("${img_path:/var/www/juick.com/i/}") + @Value("${img_path:#{systemEnvironment['TEMP']}}") private String imgDir; - @Value("${upload_tmp_dir:/var/www/juick.com/i/tmp/}") + @Value("${upload_tmp_dir:#{systemEnvironment['TEMP']}}") private String tmpDir; private static final Logger logger = LoggerFactory.getLogger(NewMessage.class); 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 01dfcdcb..d0c2f8ec 100644 --- a/juick-www/src/test/java/com/juick/www/WebAppTests.java +++ b/juick-www/src/test/java/com/juick/www/WebAppTests.java @@ -120,7 +120,7 @@ public class WebAppTests { @Inject private PebbleEngine pebbleEngine; - @Value("${img_path:/tmp}") + @Value("${img_path:#{systemEnvironment['TEMP']}}") private String imgPath; private static User ugnich, freefd; -- cgit v1.2.3