From 91ee5d2578868125fcaf35d6fe08ef3604640cd6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 14 Dec 2016 17:26:29 +0300 Subject: juick-notifications: components should not depend on database --- .../src/main/java/com/juick/components/Notifications.java | 6 +++--- .../juick/components/configuration/NotificationsInitializer.java | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'juick-notifications/src') diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java index f98fdcce..b06e0abf 100644 --- a/juick-notifications/src/main/java/com/juick/components/Notifications.java +++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java @@ -55,6 +55,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** * @author Ugnich Anton @@ -277,10 +278,9 @@ public class Notifications implements AutoCloseable { } static String stringifyWnsHttpHeaders(final Header[] allHeaders) { - String[] wnsHeaders = Arrays.stream(allHeaders) + return Arrays.stream(allHeaders) .filter(x -> x.getName().startsWith("X-WNS-") || x.getName().startsWith("WWW-")) .map(x -> x.getName() + ": " + x.getValue()) - .toArray(String[]::new); - return String.join("\n", wnsHeaders); + .collect(Collectors.joining("\n")); } } diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java index 48ff52c2..ddd734d1 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java @@ -1,6 +1,5 @@ package com.juick.components.configuration; -import com.juick.configuration.DataConfiguration; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @@ -13,7 +12,7 @@ public class NotificationsInitializer extends AbstractAnnotationConfigDispatcher @Override protected Class[] getRootConfigClasses() { - return new Class[]{NotificationsAppConfiguration.class, DataConfiguration.class}; + return new Class[]{NotificationsAppConfiguration.class}; } @Override -- cgit v1.2.3