From 9a4add44ecbd32dea6ac3d30fd81ae1ac82e3dbc Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 15 Oct 2017 05:37:18 +0300 Subject: api: ImagesService --- juick-rss/src/main/java/com/juick/rss/MessagesView.java | 2 +- .../src/main/java/com/juick/rss/configuration/RssInitializer.java | 3 +-- juick-rss/src/test/java/com/juick/rss/tests/RSSTests.java | 7 ++----- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'juick-rss') diff --git a/juick-rss/src/main/java/com/juick/rss/MessagesView.java b/juick-rss/src/main/java/com/juick/rss/MessagesView.java index 146641c5..ae06412b 100644 --- a/juick-rss/src/main/java/com/juick/rss/MessagesView.java +++ b/juick-rss/src/main/java/com/juick/rss/MessagesView.java @@ -125,7 +125,7 @@ public class MessagesView extends AbstractRssFeedView { String type = msg.getAttachmentType().equals("jpg") ? "image/jpeg" : "image/png"; MediaEntryModuleImpl module = new MediaEntryModuleImpl(); try { - UrlReference reference = new UrlReference(msg.getAttachmentURL()); + UrlReference reference = new UrlReference(msg.getAttachment().getUrl()); MediaContent mediaContent = new MediaContent(reference); mediaContent.setType(type); Metadata metadata = new Metadata(); diff --git a/juick-rss/src/main/java/com/juick/rss/configuration/RssInitializer.java b/juick-rss/src/main/java/com/juick/rss/configuration/RssInitializer.java index d6fe6e20..617da288 100644 --- a/juick-rss/src/main/java/com/juick/rss/configuration/RssInitializer.java +++ b/juick-rss/src/main/java/com/juick/rss/configuration/RssInitializer.java @@ -17,7 +17,6 @@ package com.juick.rss.configuration; -import com.juick.configuration.DataConfiguration; import org.apache.commons.codec.CharEncoding; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @@ -31,7 +30,7 @@ public class RssInitializer extends AbstractAnnotationConfigDispatcherServletIni @Override protected Class[] getRootConfigClasses() { - return new Class[]{RssAppConfiguration.class, DataConfiguration.class}; + return new Class[]{RssAppConfiguration.class}; } @Override diff --git a/juick-rss/src/test/java/com/juick/rss/tests/RSSTests.java b/juick-rss/src/test/java/com/juick/rss/tests/RSSTests.java index 1edfe0d2..7c356771 100644 --- a/juick-rss/src/test/java/com/juick/rss/tests/RSSTests.java +++ b/juick-rss/src/test/java/com/juick/rss/tests/RSSTests.java @@ -20,7 +20,6 @@ package com.juick.rss.tests; import com.juick.Message; import com.juick.Tag; import com.juick.User; -import com.juick.configuration.DataConfiguration; import com.juick.rss.configuration.RssAppConfiguration; import com.juick.rss.configuration.RssMvcConfiguration; import com.juick.service.MessagesService; @@ -50,9 +49,7 @@ import java.util.List; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.xpath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Created by vitalyster on 13.12.2016. @@ -62,7 +59,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @WebAppConfiguration public class RSSTests { @Configuration - @Import(value = {RssMvcConfiguration.class, RssAppConfiguration.class, DataConfiguration.class}) + @Import(value = {RssMvcConfiguration.class, RssAppConfiguration.class}) static class Config { @Bean @Primary -- cgit v1.2.3