diff options
author | Alexander Alexeev | 2016-11-30 15:33:13 +0700 |
---|---|---|
committer | Alexander Alexeev | 2016-11-30 15:33:13 +0700 |
commit | 6d1e79d97573218b51053d41af4f9328a1e6921f (patch) | |
tree | 1855eeeb1ceedb8f95463db94715331b3291bcbb /juick-notifications/src/main/java/com | |
parent | 1d837a835c04078ec66325e9fb9de21ac401874e (diff) |
notification properties are added to example configuration
Diffstat (limited to 'juick-notifications/src/main/java/com')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java index ff3a5a5a..67a551c4 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java @@ -1,12 +1,10 @@ package com.juick.components.configuration; import com.juick.components.Notifications; -import com.juick.configuration.DataConfiguration; import com.notnoop.apns.APNS; import com.notnoop.apns.ApnsService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.http.client.ClientHttpRequestInterceptor; @@ -30,10 +28,11 @@ public class NotificationsAppConfiguration { @Bean public RestTemplate rest() { RestTemplate rest = new RestTemplate(); - List<ClientHttpRequestInterceptor> interceptors = Collections - .singletonList( - new BasicAuthorizationInterceptor(env.getProperty("api_user", "juick"), - env.getProperty("api_password", "secret"))); + List<ClientHttpRequestInterceptor> interceptors = Collections.singletonList( + new BasicAuthorizationInterceptor( + env.getProperty("api_user", "juick"), + env.getProperty("api_password", "secret"))); + rest.setRequestFactory(new InterceptingClientHttpRequestFactory(rest.getRequestFactory(), interceptors)); return rest; } @@ -42,6 +41,7 @@ public class NotificationsAppConfiguration { public Notifications push() { return new Notifications(env, rest()); } + @Bean public ApnsService apns() { return APNS.newService().withCert(env.getProperty("ios_pkcs12_file"), env.getProperty("ios_pkcs12_password")) |