aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/java/com/juick/service/CloudflareCache.java6
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/SapeConfiguration.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WebSecurityConfig.java2
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java14
-rw-r--r--juick-www/src/test/java/com/juick/www/WebAppTests.java2
5 files changed, 14 insertions, 12 deletions
diff --git a/juick-www/src/main/java/com/juick/service/CloudflareCache.java b/juick-www/src/main/java/com/juick/service/CloudflareCache.java
index 00e1f684..5046f692 100644
--- a/juick-www/src/main/java/com/juick/service/CloudflareCache.java
+++ b/juick-www/src/main/java/com/juick/service/CloudflareCache.java
@@ -18,11 +18,11 @@ import java.util.Collections;
public class CloudflareCache implements ApplicationListener<UserUpdatedEvent> {
private static final Logger logger = LoggerFactory.getLogger(CloudflareCache.class);
- @Value("${cloudflare_auth_email}")
+ @Value("${cloudflare_auth_email:email@example.com}")
private String authEmail;
- @Value("${cloudflare_api_key}")
+ @Value("${cloudflare_api_key:secret}")
private String apiKey;
- @Value("${cloudflare_zone_id}")
+ @Value("${cloudflare_zone_id:zoneid}")
private String zoneId;
private final static String baseUri = "https://api.cloudflare.com/client/v4";
@Override
diff --git a/juick-www/src/main/java/com/juick/www/configuration/SapeConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/SapeConfiguration.java
index 006c159c..68ff28d2 100644
--- a/juick-www/src/main/java/com/juick/www/configuration/SapeConfiguration.java
+++ b/juick-www/src/main/java/com/juick/www/configuration/SapeConfiguration.java
@@ -27,7 +27,7 @@ import ru.sape.Sape;
*/
@Configuration
public class SapeConfiguration {
- @Value("${sape_user}")
+ @Value("${sape_user:secret}")
private String token;
@Bean
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 bde85ee4..19329dad 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
@@ -41,7 +41,7 @@ import javax.annotation.Resource;
*/
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
- @Value("${auth_remember_me_key}")
+ @Value("${auth_remember_me_key:secret}")
private String rememberMeKey;
@Value("${web_domain:localhost}")
private String webDomain;
diff --git a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java
index 64d59b9f..674be157 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java
@@ -66,9 +66,9 @@ public class SocialLogin {
private static final Logger logger = LoggerFactory.getLogger(SocialLogin.class);
- @Value("${facebook_appid}")
+ @Value("${facebook_appid:appid}")
private String FACEBOOK_APPID;
- @Value("${facebook_secret}")
+ @Value("${facebook_secret:secret}")
private String FACEBOOK_SECRET;
private static final String FACEBOOK_REDIRECT = "http://juick.com/_fblogin";
private static final String VK_REDIRECT = "http://juick.com/_vklogin";
@@ -77,15 +77,15 @@ public class SocialLogin {
private ObjectMapper jsonMapper;
private ServiceBuilder facebookBuilder, twitterBuilder, vkBuilder;
- @Value("${twitter_consumer_key}")
+ @Value("${twitter_consumer_key:appid}")
private String twitterConsumerKey;
- @Value("${twitter_consumer_secret}")
+ @Value("${twitter_consumer_secret:secret}")
private String twitterConsumerSecret;
- @Value("${vk_appid}")
+ @Value("${vk_appid:appid}")
private String VK_APPID;
- @Value("${vk_secret}")
+ @Value("${vk_secret:secret}")
private String VK_SECRET;
- @Value("${telegram_token}")
+ @Value("${telegram_token:secret}")
private String telegramToken;
@Inject
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 60e0fae6..e3ac53cf 100644
--- a/juick-www/src/test/java/com/juick/www/WebAppTests.java
+++ b/juick-www/src/test/java/com/juick/www/WebAppTests.java
@@ -26,6 +26,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage;
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.ImagesService;
import com.juick.service.MessagesService;
@@ -88,6 +89,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = {
+ DataConfiguration.class,
WwwServletConfiguration.class, WwwAppConfiguration.class, SapeConfiguration.class,
RepositoryConfiguration.class, WebSecurityConfig.class
})